Library "MathSearchDijkstra" Shortest Path Tree Search Methods using Dijkstra Algorithm. min_distance(distances, flagged_vertices) Find the lowest cost/distance. Parameters: distances : float array, data set with distance costs to start index. flagged_vertices : bool array, data set with visited vertices flags. Returns: int, lowest cost/distance...
Introduction This is an open source strategy which provides a framework for webhook enabled projects. It is designed to work out-of-the-box on any instrument triggering on an intraday bar interval. This is a full featured script with an emphasis on actual trading at a brokerage through the TradingView alert mechanism and without requiring browser plugins....
Hello traders! You know, machine learning is a very popular theme nowadays. The best tricks and methods were borrowed from Math and Computer Science to improve and create ML algorithms. As you know, one of our analysts is a great fan of ML, thus he decided to borrow on very powerful method from ML. We have taken 5 indicators, tuned them a bit and make them to...
Level: 2 Background @pips_v1 has proposed an interesting idea that is it possible to code an "Adaptive Jon Andersen R-Squared Indicator" where the length is determined by DCPeriod as calculated in Ehlers Sine Wave Indicator? I agree with him and starting to construct this indicator. After a study, I found "(blackcat) L2 Ehlers Autocorrelation Periodogram"...
Estimation of the Nth percentile of a series When working with built-in functions in TradingView we have to limit our length parameters to max 4999. In case we want to use a function on the whole available series (bar 0 all the way to the current bar), we can usually not do this without manually creating these calculations in our code. For things like mean or...
This script uses the Repeated Median (RM) estimator to construct a linear regression channel and thus offers an alternative to the available codes based on ordinary least squares. The RM estimator is a robust linear regression algorithm. It was proposed by Siegel in 1982 (1) and has since found many applications in science and engineering for linear trend...
Hello All, I think all of you know the game "Tic Tac Toe" :) This time I tried to make this game, and also I tried to share an example to develop a game script in Pine. Just for fun ;) Tic Tac Toe Game Rules: 1. The game is played on a grid that's 3 squares by 3 squares. 2. You are "O", the computer is X. Players take turns putting their marks in empty...
Multi-timeframe Strategy based on Logistic Regression algorithm Description: This strategy uses a classic machine learning algorithm that came from statistics - Logistic Regression (LR). The first and most important thing about logistic regression is that it is not a 'Regression' but a 'Classification' algorithm. The name itself is somewhat misleading....
Level: 2 Background John F. Ehlers introduced Autocorrelation Periodogram in his "Cycle Analytics for Traders" chapter 8 on 2013. Function Construction of the autocorrelation periodogram starts with the autocorrelation function using the minimum three bars of averaging. The cyclic information is extracted using a discrete Fourier transform (DFT) of the...
Thanks to the developers for adding arrays to TradingView. This gives you more freedom in Pine Script coding. I have created an algorithm that draws support and resistance levels on a chart. The algorithm can be easily customized as you need. This algorithm can help both intuitive and system traders. Intuitive traders just look at the drawn lines. For system...
For all the McGinley enthusiasts out there, this is my improved version of the "McGinley Dynamic", originally formulated and publicized in 1990 by John R. McGinley, Jr. Prior to this release, I recently had an encounter with a member request regarding the reliability and stability of the general algorithm. Years ago, I attempted to discover the root of it's...
This script utilizes this concept. Instead of weighting by volume, it weights by amount of price action on every close price of the rolling window. I assume it can be used as an additional reference point for price mode and price antimode. it is directly connected with Market (not volume) profile, or TPO charts. The algorithm: 1) takes a rolling window of,...
Now you can plot a "Renko" chart on any timeframe for free! As with my previous algorithm, you can plot the "Linear Break" chart on any timeframe for free! I again decided to help TradingView programmers and wrote code that converts a standard candles / bars to a "Renko" chart. The built-in renko() and security() functions for constructing a "Renko" chart are...
This conceptual strategy trades against the short-term trend. The first position can be either long or short. In the short-term, prices fluctuate up and down on wide spread exchanges. And if the price moves to one side, the price tends to return to its original position momentarily. This strategy set stop order. Stop price is calculated with upper and lower shadows.
This is my first public release of detector code entitled "Enhanced Instantaneous Cycle Period" for PSv4.0 I built many months ago. Be forewarned, this is not an indicator, this is a detector to be used by ADVANCED developers to build futuristic indicators in Pine. The origins of this script come from a document by Dr. John Ehlers entitled "SIGNAL ANALYSIS...
This script allows you to add two moving averages to a chart, where the type of moving average can be chosen from a collection of 15 different moving average algorithms. Each moving average can also have different lengths and crossovers/unders can be displayed and alerted on. The supported moving average types are: Simple Moving Average ( SMA ) Exponential...
While trying to figure out how to make the STDEV function use an exponential moving average instead of simple moving average , I discovered the builtin function doesn't really use either. Check it out, it's amazing how different the two-pass algorithm is from the builtin! Eventually I reverse-engineered and discovered that STDEV uses the Naiive algorithm and...
VOLUME PRESSURE COMPOSITE AVERAGE WITH BANDS Ver. 1.0.beta.10.08.2015 By Ricardo M Arjona @XeL_Arjona DISCLAIMER: The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets. The...