[blackcat] L2 Ehlers Adaptive Jon Andersen R-Squared IndicatorLevel: 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" script could be reused for this purpose because Ehlers Autocorrelation Periodogram is an ideal candidate to calculate the dominant cycle. On the other hand, there are two inputs for R-Squared indicator:
Length - number of bars to calculate moment correlation coefficient R
AvgLen - number of bars to calculate average R-square
I used Ehlers Autocorrelation Periodogram to produced a dynamic value of "Length" of R-Squared indicator and make it adaptive.
Function
One tool available in forecasting the trendiness of the breakout is the coefficient of determination (R-squared), a statistical measurement. The R-squared indicates linear strength between the security's price (the Y - axis) and time (the X - axis). The R-squared is the percentage of squared error that the linear regression can eliminate if it were used as the predictor instead of the mean value. If the R-squared were 0.99, then the linear regression would eliminate 99% of the error for prediction versus predicting closing prices using a simple moving average.
When the R-squared is at an extreme low, indicating that the mean is a better predictor than regression, it can only increase, indicating that the regression is becoming a better predictor than the mean. The opposite is true for extreme high values of the R-squared.
To make this indicator adaptive, the dominant cycle is extracted from the spectral estimate in the next block of code using a center-of-gravity ( CG ) algorithm. The CG algorithm measures the average center of two-dimensional objects. The algorithm computes the average period at which the powers are centered. That is the dominant cycle. The dominant cycle is a value that varies with time. The spectrum values vary between 0 and 1 after being normalized. These values are converted to colors. When the spectrum is greater than 0.5, the colors combine red and yellow, with yellow being the result when spectrum = 1 and red being the result when the spectrum = 0.5. When the spectrum is less than 0.5, the red saturation is decreased, with the result the color is black when spectrum = 0.
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 autocorrelation results. This approach has at least four distinct advantages over other spectral estimation techniques. These are:
1. Rapid response. The spectral estimates start to form within a half-cycle period of their initiation.
2. Relative cyclic power as a function of time is estimated. The autocorrelation at all cycle periods can be low if there are no cycles present, for example, during a trend. Previous works treated the maximum cycle amplitude at each time bar equally.
3. The autocorrelation is constrained to be between minus one and plus one regardless of the period of the measured cycle period. This obviates the need to compensate for Spectral Dilation of the cycle amplitude as a function of the cycle period.
4. The resolution of the cyclic measurement is inherently high and is independent of any windowing function of the price data.
Key Signal
DC --> Ehlers dominant cycle.
AvgSqrR --> R-squared output of the indicator.
Remarks
This is a Level 2 free and open source indicator.
Feedbacks are appreciated.
Komut dosyalarını "algo" için ara
Fibonacci Extension / Retracement / Pivot Points by DGTFɪʙᴏɴᴀᴄᴄɪ Exᴛᴇɴᴛɪᴏɴ / Rᴇᴛʀᴀᴄᴍᴇɴᴛ / Pɪᴠᴏᴛ Pᴏɪɴᴛꜱ
This study combines various Fibonacci concepts into one, and some basic volume and volatility indications
█ Pɪᴠᴏᴛ Pᴏɪɴᴛꜱ — is a technical indicator that is used to determine the levels at which price may face support or resistance. The Pivot Points indicator consists of a pivot point (PP) level and several support (S) and resistance (R) levels. PP, resistance and support values are calculated in different ways, depending on the type of the indicator, this study implements Fibonacci Pivot Points
The indicator resolution is set by the input of the Pivot Points TF (Timeframe). If the Pivot Points TF is set to AUTO (the default value), then the increased resolution is determined by the following algorithm:
for intraday resolutions up to and including 5 min, 4HOURS (4H) is used
for intraday resolutions more than 5 min and up to and including 45 min, DAY (1D) is used
for intraday resolutions more than 45 min and up to and including 4 hour, WEEK (1W) is used
for daily resolutions MONTH is used (1M)
for weekly resolutions, 3-MONTH (3M) is used
for monthly resolutions, 12-MONTH (12M) is used
If the Pivot Points TF is set to User Defined, users may choose any higher timeframe of their preference
█ Fɪʙ Rᴇᴛʀᴀᴄᴇᴍᴇɴᴛ — Fibonacci retracements is a popular instrument used by technical analysts to determine support and resistance areas. In technical analysis, this tool is created by taking two extreme points (usually a peak and a trough) on the chart and dividing the vertical distance by the key Fibonacci coefficients equal to 23.6%, 38.2%, 50%, 61.8%, and 100%. This study implements an automated method of identifying the pivot lows/highs and automatically draws horizontal lines that are used to determine possible support and resistance levels
█ Fɪʙᴏɴᴀᴄᴄɪ Exᴛᴇɴꜱɪᴏɴꜱ — Fibonacci extensions are a tool that traders can use to establish profit targets or estimate how far a price may travel AFTER a retracement/pullback is finished. Extension levels are also possible areas where the price may reverse. This study implements an automated method of identifying the pivot lows/highs and automatically draws horizontal lines that are used to determine possible support and resistance levels.
IMPORTANT NOTE: Fibonacci extensions option may require to do further adjustment of the study parameters for proper usage. Extensions are aimed to be used when a trend is present and they aim to measure how far a price may travel AFTER a retracement/pullback. I will strongly suggest users of this study to check the education post for further details, where to use extensions and where to use retracements
Important input options for both Fibonacci Extensions and Retracements
Deviation, is a multiplier that affects how much the price should deviate from the previous pivot in order for the bar to become a new pivot. Increasing its value is one way to get higher timeframe Fib Retracement Levels
Depth, affects the minimum number of bars that will be taken into account when building
█ Volume / Volatility Add-Ons
High Volatile Bar Indication
Volume Spike Bar Indication
Volume Weighted Colored Bars
This study benefits from build-in auto fib retracement tv study and modifications applied to get extentions and also to fit this combo
Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
Repeated Median Regression ChannelThis 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 estimation and data filtering.
The key difference between RM and ordinary least squares methods is that the slope of the RM line is significantly less affected by data points that deviate strongly from the established trend. In statistics, these points are usually called outliers, while in the context of price data, they are associated with gaps, reversals, breaks from the trading range. Thus, robustness to outlier means that the nascent deviation from a predetermined trend will be more clearly seen in the RM regression compared to the least-squares estimate. For the same reason, the RM model is expected to better depict gaps and trend changes (2).
Input Description
Length : Determines the length of the regression line.
Channel Multiplier : Determines the channel width in units of root-mean-square deviation.
Show Channel : If switched off , only the (central) regression line is displayed.
Show Historical Broken Channel : If switched on , the channels that were broken in the past are displayed. Note that a certain historical broken channel is shown only when at least Length / 2 bars have passed since the last historical broken channel.
Print Slope : Displays the value of the current RM slope on the graph.
Method
Calculation of the RM regression line is done as follows (1,3):
For each sample point ( t (i), y (i)) with i = 1.. Length , the algorithm calculates the median of all the slopes of the lines connecting this point to the other Length -1 points.
The regression slope is defined as the median of the set of these median slopes.
The regression intercept is defined as the median of the set { y (i) – m * t (i)}.
Computational Time
The present implementation utilizes a brute-force algorithm for computing the RM-slope that takes O ( Length ^2) time. Therefore, the calculation of the historical broken channels might take a relatively long time (depending on the Length parameter). However, when the Show Historical Broken Channel option is off, only the real-time RM channel is calculated, and this is done quite fast.
References
1. A. F. Siegel (1982), Robust regression using repeated medians, Biometrika, 69 , 242–244.
2. P. L. Davies, R. Fried, and U. Gather (2004), Robust signal extraction for on-line monitoring data, Journal of Statistical Planning and Inference 122 , 65-78.
3. en.wikipedia.org
Tic Tac Toe (For Fun)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 squares.
3. if a player makes 3 of her marks in a row (up, down, across, or diagonally) the he is the winner.
4. When all 9 squares are full, the game is over (draw)
So, how to play the game?
- The player/you can play "O", meaning your mark is "O", so Xs for the script. please note that: The script plays with ONLY X
- There is naming for all squears, A1, A2, A3, B1, B2, B3, C1, C2, C3. you will see all these squares in the options.
- also You can set who will play first => "Human" or "Computer"
if it's your turn to move then you will see "You Move" text, as seen in the following screenshot. for example you want to put "O" to "A1" then using options set A1 as O
How the script play?
it uses MinMax algorithm with constant depth = 4. And yes we don't have option to make recursive functions in Pine at the moment so I made four functions for each depth. this idea can be used in your scripts if you need such an algorithm. if you have no idea about MinMax algorithm you can find a lot of articles on the net :)
The script plays its move automatically if its turn to play. you will just need to set the option that computer played (A1, C3, etc)
if it's computer turn to play then it calculates and show the move it wants to play like "My Move : B3 <= X" then using options you need to set B3 as X
Also it checks if the board is valid or not:
I have tested it but if you see any bug let me know please
Enjoy!
Max Drawdown Calculating Functions (Optimized)Maximum Drawdown and Maximum Relative Drawdown% calculating functions.
I needed a way to calculate the maxDD% of a serie of datas from an array (the different values of my balance account). I didn't find any builtin pinescript way to do it, so here it is.
There are 2 algorithms to calculate maxDD and relative maxDD%, one non optimized needs n*(n - 1)/2 comparisons for a collection of n datas, the other one only needs n-1 comparisons.
In the example we calculate the maxDDs of the last 10 close values.
There a 2 functions : "maximum_relative_drawdown" and "maximum_dradown" (and "optimized_maximum_relative_drawdown" and "optimized_maximum_drawdown") with names speaking for themselves.
Input : an array of floats of arbitrary size (the values we want the DD of)
Output : an array of 4 values
I added the iteration number just for fun.
Basically my script is the implementation of these 2 algos I found on the net :
var peak = 0;
var n = prices.length
for (var i = 1; i < n; i++){
dif = prices - prices ;
peak = dif < 0 ? i : peak;
maxDrawdown = maxDrawdown > dif ? maxDrawdown : dif;
}
var n = prices.length
for (var i = 0; i < n; i++){
for (var j = i + 1; j < n; j++){
dif = prices - prices ;
maxDrawdown = maxDrawdown > dif ? maxDrawdown : dif;
}
}
Feel free to use it.
@version=4
TopTenAlg0 1. Sentiment & MomentumEN: Mum Sentiment & Momentum is an indicator that measures the psychological thresholds of the O candle and the rate of change of the price (Rate of Chance / Bar Momentum). Each price action is a separate action with flexibility. Mum Sentiment & Momentum shows you the speed and direction of this price action. If sentiment and momentum are green, the rise will continue, if it is much above momentum sentiment, it indicates the presence of an enthusiastic psychological movement. If sentiment and momentum are red, a correction may come and a decrease is expected, and if momentum is well below sentiment, there is an enthusiastic sale.
This algorithm is prepared with @Top10Algo ... Optimization periods
TR: Mum Sentiment & Momentum her barda ayrı ayrı olmak üzere O muma ait psikolojik eşikleri ve fiyatın değişim hızını ( Rate of Chance / Mum Momentumu ) ölçen bir göstergedir. Her bir fiyat hareketi esnekliği olan ayrı birer aksiyondur. Mum Sentiment & Momentum size bu fiyat aksiyonunun hızını ve yönünün ne olduğunu gösterir. Eğer sentiment ve momentum yeşil ise yükselişin devam edeceğini, momentum sentiment’ in çok üstünde ise coşkulu bir psikolojik hareketin varlığını gösterir. Eğer sentiment ve momentum kırmızı ise düzeltme gelebileceğini ve düşüş beklenildiğini, momentum ise sentiment’in çok altında ise coşkulu bir satış’ ın olduğunu gösterir.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır... Periyotlar optimize edilmiştir.
TopTenAlgo 4. Trend Velocity & Quality with Missmatch AlertEN: The Trend Velocity & Quality oscillator, in addition to a classic Rsi indicator, precisely measures the speed and quality of the trend. Rsi is actually a tense indicator that makes technical analysis difficult. For this reason, it makes it difficult for you to get false signals and trade the trend by not being able to analyze the direction of the trend clearly. The Rsi Trend Velocity & Quality oscillator produces more meaningful thresholds with the functions it contains, showing tighter postures that are not tense. It also causes Rsi to move faster without fear of distortion due to excessive noise, causing you to receive signals earlier. In short, it is a smoother oscillator that produces tighter postures, better thresholds, a faster Rsi and early signals.
This algorithm is prepared with @Top10Algo ... Add Mismatch Alerts
TR: Trend Velocity & Quality osilatörü klasik bir Rsi indikatörüne ek olarak trendin hızını ve kalitesini hassas bir biçimde ölçer. Rsi aslında teknik analizi zorlaştıran gergin bir indikatördür. Bu sebeple yanlış sinyaller almanıza ve trendin yönünü net analiz edememenize sebep olarak trade etmenizi zorlaştırır. Rsi Trend Velocity & Quality osilatörü içerdiği fonksiyonlar ile gergin olmayan daha sıkı duruşlar sergileyerek daha anlamlı eşikler üretir. Ayrıca aşırı gürültüye bağlı bozulma korkusu olmadan Rsi’ ın daha hızlı hareket etmesine sebep olarak daha erken sinyal almanıza vesile olur. Yani özetle daha sıkı duruşlar, daha iyi eşikler, daha hızlı bir Rsi ve erken sinyaller üreten pürüzsüz bir osilatördür.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır... Uyumsuzluk Uyarıları ve Alarmları Eklendi...
TopTenAlgo 5. Missmatch OscillatorEN: The Incompatibility Oscillator is an indicator used to detect trend turns and to catch mismatches in rising or falling waves. The Incompatibility Oscillator measures the mismatch between artificial pricing and actual price with a trend in the market compared to a Center Of Gravity . When designing the oscillator, my goal was to catch positive or negative mismatches as in RSI . Because most of the RSI incompatibilities are not working or running late, especially on short term charts. My goal was to eliminate the illusion here. I do not use any predefined indicators ( RSI etc.) in the Incompatibility Osilautre. It consists of a multiline mathematical function that scans the oscillator price movement in 100 steps. The aim here is to measure the price and the speed of the trend at the same time and catch the mismatches at the end of the trend.
This algorithm is prepared with @Top10Algo ...
TR: Uyumsuzluk Osilatörü trend dönüşlerini tespit etmek için ve yükseliş yada düşüş dalgalarındaki uyumsuzlukları yakalamak için kullanılan bir göstergedir. Uyumsuzluk Osilatörü piyasada trendle birlikte oluşa yapay fiyatlama ile gerçek fiyat arasındaki uyumsuzluğu bir ağırlık merkezine göre(Center Of Gravity ) ölçer. Osilatörü tasarlarken amacım RSI’ daki gibi pozitif yada negatif uyumsuzlukları yakalamaktı. Çünkü RSI uyumsuzlukların çoğu özelliklede kısa vade grafiklerde ya çalışmıyor yada geç çalışıyor. Amacım burdaki yanılgıyı ortadan kaldırmaktı. Uyumsuzluk Osilaötründe herhangi bir ön tanımlı gösterge( RSI vs.) kullanmıyorum. Osilatör fiyat hareketini 100 adımda tarayan bir multiline matemetiksel fonksiyondan oluşuyor. Burada amaç fiyat ile trendin hızını aynı anda ölçmek ve trend sonlarındaki uyumsuzlukları yakalamaktır.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır...
TopTenAlgo 6. Trading IndexEN: Trend & Trading Index Oscillator is an indicator developed using Stochastic which makes your day trading easier. Is it to measure price swings with a more sensitive and close to zero error margin, and is the price movement and the direction of the trend compatible? is the ideal guide to look at. The oscillator consists of a 5 step system. Depressions below -0.85 are measured to determine the intake region (Lowlander 2) at the bottom of the step. At the top of the step, enthusiastic movements above 0.90 are detected to determine the sales region(Highlander 2). The buffer zone is the BALANCE "0" zone and its highlander "0. 40 zone close to enthusiasm, and the Lowlander "-0.50" zone close to depression.
This algorithm is prepared with @Top10Algo ... Study modify...
TR: Trend & Trading Index Osiatörü Stochastic kullanırak geliştirilen ve gün içi al satlarınızı kolaylaştıran bir göstergedir. Fiyat salınımlarını daha hassas ve sıfıra yakın bir hatalama payıyla ölçmek ve fiyat hareketi ile trendin yönü uyumlu mu? bakmak için en ideal yol göstericidir. Osilatör 5 basamaklı bir sistemden oluşmaktadır. Basamağın en altında alım bögesini belirlemek için -0.85 değerinin altındaki depresyonlar(Lowlander 2) ölçülür. Basamağın en üstünde ise satış bölgesini belirlemek için 0.90 değerinin üstündeki coşkulu hareketler (Highlander 2) tespit edilir. Ara bölge ise BALANCE “0” bögesi ve onun coşkuya yakın Highlander 1 “0.40" bölgesi ile depresyona yakın Lowlander 1 “-0.50" bölgesi yer alır.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır... Çalışma Prensipleri modifiye edildi...
TopTenAlgo 7. Linear Trend Tracking (Without Volume & Coloring)EN:
Dogrusal Trend Takipcisi is used in conjunction with Gosterge Trend. Both indicators are for approval of each other. While the Indicator looks at Logarithmic to prices, It looks at Linear. Although its mathematical function is stuck between two trend lines like Gösterge Trend, the Dogrusal Trend Takipcisi can also be used as the main histogram, the absolute value of the difference between the trend and the down trend line .
If the uptrend line is larger than the downtrend, histogram bars are light green or dark green areas. When the bullish trend line now crosses the down trend line , the bar is dark green. When the up trend line is larger than the down trend line and the up trend line increases, the bars also become dark green. This tendency starts to keep getting stronger. If the bullish trend line is larger than the bearish trend line but decreases, the bars are light green. This is when the bullish trend loses strength, So, Uptrend is weakening.
If the downtrend line is larger than the bullish trend line , a negative occur, and the bars become red or light red. If the bearish trend line has exceeded the bullish trend line or the value is increasing, the bar is in red. If the bearish trend line is larger than the bullish trend line but the value is decreasing, the bars are light red. This comes when the downward trend is losing power. So, Downtrend is weakening. For symbols for which the Volume Indicator cannot be read.
This algorithm is prepared with @Top10Algo ...
TR: Doğrusal Trend Takipçisi Gösterge Trendle ile beraber kullanılır. Her iki göstergede birbirinin onayını almak içindir. Gösterge Trend fiyatlara logaritmik bakarken, Doğrusal Tren Takipçisi Linear bakar. Matematiksel fonsiyonu Gösterge Trend gibi iki trend çizgisi arasına sıkışmış olsada Doğrusal Trend Takipçisi ayrıca ana histogram olarak gösterilen yukarı trend ve aşağı trend çizgisi arasındaki farkın mutlak değerini linear olarak hesaplayarak momentumun gücünü ölçer ve size zayıflayan trendleri haber eder.gösterir.
Yukarı trend çizgisi aşağı trendden büyükse (bu nedenle pozitif hareketi gösterir), histogram çubukları açık yeşil veya koyu yeşil olacaktır. Artış trendi çizgisi şimdi aşağı trend çizgisini geçtiğinde, çubuk koyu yeşil olacaktır. Yukarı trend çizgisi aşağı trend çizgisinden daha büyük olduğunda ve yukarı trend çizgisi arttığında çubuklar da koyu yeşil olur. Bu eğilimin güçlenmeye devam ettiği anlamına geliyor. Yükseliş trendi çizgisi düşüş trendi çizgisinden büyükse ancak azalıyorsa, çubuklar açık yeşil olacaktır. Bu yükseliş eğiliminin güç kaybettiği anlamına gelir.Yani yükseliş trendi zayıflıyordur.
Düşüş trendi çizgisi yükseliş trendi çizgisinden büyükse, olumsuz bir eğilim oluşur ve çubuklar kırmızı veya açık kırmızı olur. Düşüş trendi çizgisi yükseliş trendi çizgisini aştıysa veya değer artıyorsa, çubuk kırmızı olacaktır. Düşüş trendi çizgisi yükseliş trendi çizgisinden büyükse, ancak değer azalıyorsa, çubuklar açık kırmızı olacaktır. Bu düşüş eğiliminin güç kaybettiği anlamına gelir. Yani düşüş trendi zayıflıyordur. Hacim Göstergesinin okunamadığı semboller içindir.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır...
TopTenAlgo 7. Linear Trend Tracking (Include Volume & Coloring)EN:
Dogrusal Trend Takipcisi is used in conjunction with Gosterge Trend. Both indicators are for approval of each other. While the Indicator looks at Logarithmic to prices, It looks at Linear. Although its mathematical function is stuck between two trend lines like Gösterge Trend, the Dogrusal Trend Takipcisi can also be used as the main histogram, the absolute value of the difference between the trend and the down trend line .
If the uptrend line is larger than the downtrend, histogram bars are light green or dark green areas. When the bullish trend line now crosses the down trend line , the bar is dark green. When the up trend line is larger than the down trend line and the up trend line increases, the bars also become dark green. This tendency starts to keep getting stronger. If the bullish trend line is larger than the bearish trend line but decreases, the bars are light green. This is when the bullish trend loses strength, So, Uptrend is weakening.
If the downtrend line is larger than the bullish trend line , a negative occur, and the bars become red or light red. If the bearish trend line has exceeded the bullish trend line or the value is increasing, the bar is in red. If the bearish trend line is larger than the bullish trend line but the value is decreasing, the bars are light red. This comes when the downward trend is losing power. So, Downtrend is weakening.
This algorithm is prepared with @Top10Algo ...
TR: Doğrusal Trend Takipçisi Gösterge Trendle ile beraber kullanılır. Her iki göstergede birbirinin onayını almak içindir. Gösterge Trend fiyatlara logaritmik bakarken, Doğrusal Tren Takipçisi Linear bakar. Matematiksel fonsiyonu Gösterge Trend gibi iki trend çizgisi arasına sıkışmış olsada Doğrusal Trend Takipçisi ayrıca ana histogram olarak gösterilen yukarı trend ve aşağı trend çizgisi arasındaki farkın mutlak değerini linear olarak hesaplayarak momentumun gücünü ölçer ve size zayıflayan trendleri haber eder.gösterir.
Yukarı trend çizgisi aşağı trendden büyükse (bu nedenle pozitif hareketi gösterir), histogram çubukları açık yeşil veya koyu yeşil olacaktır. Artış trendi çizgisi şimdi aşağı trend çizgisini geçtiğinde, çubuk koyu yeşil olacaktır. Yukarı trend çizgisi aşağı trend çizgisinden daha büyük olduğunda ve yukarı trend çizgisi arttığında çubuklar da koyu yeşil olur. Bu eğilimin güçlenmeye devam ettiği anlamına geliyor. Yükseliş trendi çizgisi düşüş trendi çizgisinden büyükse ancak azalıyorsa, çubuklar açık yeşil olacaktır. Bu yükseliş eğiliminin güç kaybettiği anlamına gelir.Yani yükseliş trendi zayıflıyordur.
Düşüş trendi çizgisi yükseliş trendi çizgisinden büyükse, olumsuz bir eğilim oluşur ve çubuklar kırmızı veya açık kırmızı olur. Düşüş trendi çizgisi yükseliş trendi çizgisini aştıysa veya değer artıyorsa, çubuk kırmızı olacaktır. Düşüş trendi çizgisi yükseliş trendi çizgisinden büyükse, ancak değer azalıyorsa, çubuklar açık kırmızı olacaktır. Bu düşüş eğiliminin güç kaybettiği anlamına gelir. Yani düşüş trendi zayıflıyordur.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır...
TopTenAlgo 8. Elliottwave Cycle EN: The Elliottwaves Cycle Oscillator is an indicator that allows the detection of impulsive (impulsive / ascend) or corrective (correction / fall) waves, ie each cycle (cycle) in Elliott Waves . The aim is to measure the speed of a real trend and to predict returns. In the uptrend or impulsive movement, Cycle continues its movement in the upper band after the price is set on a certain band, while in the downtrend or corrective move, the Cycle continues its movement in the lower band.
This algorithm is prepared with @Top10Algo ...
TR: Elliottwaves Cycle Osilatörü Elliott Dalgalarında ki impulsive (itkisel/yükseliş) yada corrective (düzeltme/düşüş) dalgaların yani her bir siklus’ un (cycle) önceden tespit edilmesini sağlayan bir göstergedir. Amaç gerçek bir trendin hızını ölçmek ve geri dönüşleri önceden tespit etmektir. Yükseliş trendi içinde yada impulsive bir harekette fiyat belli bir banda oturduktan sonra Cycle üst band’ da hareketine devam ederken, düşüş trendi içinde yada corrective bir harekette fiyat belli bir banda oturduktan sonra Cycle alt bandda hareketine devam eder.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır...
TopTenAlgo 9. Formation & Patterns HuntersEN:
• All Harmonic and Triangle Formation Patterns and OBO (Added) Displays labels with detected patterns.
• Displays the slope information rate of price, time difference and pricing angle (Experimental, Vary.)
• It shows the effects such as Target Price, Stoploss price or formation start price.
• It instantly detects the formation changes and allows you to make a reversal.
This algorithm is prepared with @Top10Algo ...
TR:
• Tüm Harmonik ve Triangle Formayon Kalıpları ile OBO(Eklendi). Algılanan kalıplara sahip tüm etiketleri görüntüler.
• Fiyat, zaman farkı ve fiyatlama açısının eğim bilgi oranını görüntüler (Deneysel, Değişiklik Gösterebilir.)
• Hedef Fiyat, Stoploss fiyatı yada formasyon başlangıç fiyatı gibi etkiketleri gösterir.
• Formasyon değişiklerini anında algılayarak hızlı dönüş (reversal) yapmanızı sağlar.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır...
Reditum ScanReditum Scan allows you to synchronize the Market Profile Points of Control (POC) in different time intervals to a single graph.
Components of Reditum Scan:
POC's (30 min, 60 min, 120 min, 240 min, daily)
How does it work?
The algorithm allows you to identify areas of strong support and resistance, based on where most of the trading activity takes place.
What are the strategies for considering placing a trade?
1.Cluster (agglomeration of multiple POC's) to cluster (by identifying two clusters, the price could go smoothly from one Cluster to the other).
2. From cluster (agglomeration of multiple POCs, each with unique color. Now, from this cluster important movements may begin).
3. Towards a cluster (like the “from cluster” pattern, we identify areas of high interest for institutional companies, in this pattern the cluster acts like a magnet, if price is near it may be fully attracted towards the agglomeration).
If you are a member of the mastermind tribe please contact the support team within the tribe to access the indicator (do not leave personal or subscription data in the comments on this page), if not, please visit the link located in our signature.
Thanks for taking a look!
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Reditum Scan permite sincronizar los puntos de control (POC) de los perfiles de mercado en varios intervalos de tiempo en una sola gráfica.
Componentes de Reditum Scan:
POC´s (30 min, 60 min, 120 min, 240 min, diario)
¿Cómo funciona?
El algoritmo le permite identificar áreas de fuerte soporte y resistencia, según el lugar donde se lleva a cabo la mayor parte de la actividad comercial.
¿Cuáles son las estrategias para considerar una entrada?
1.Cluster (aglomeración de múltiples POC´s) a cluster (al identificar dos cluster el precio podría ir con fluidez desde uno al otro que lo recibe).
2.Desde cluster (lo identificamos con la aglomeración de múltiples POC identificados con colores que hacen fácil la lectura. Ahora, desde este cluster podrían iniciar movimientos importantes).
3.Hacia cluster (al igual que el patrón “desde cluster” identificamos zonas de alto interés para los institucionales, en este patrón el cluster actúa como un imán para el precio, de modo que cuando el precio está lejos de él, lo podría atraer con fuerza).
Para acceder a la herramienta, si usted es miembro de la tribu mastermind por favor comunicarse con el equipo de soporte dentro de la tribu (no dejar datos personales ni de suscripción en los comentarios de esta página), si no es miembro por favor visite el enlace a continuación en nuestra Firma.
Gracias por echarle un vistazo!.
[blackcat] L2 Ehlers Autocorrelation PeriodogramLevel: 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 autocorrelation results. This approach has at least four distinct advantages over other spectral estimation techniques. These are:
1. Rapid response. The spectral estimates start to form within a half-cycle period of their initiation.
2. Relative cyclic power as a function of time is estimated. The autocorrelation at all cycle periods can be low if there are no cycles present, for example, during a trend. Previous works treated the maximum cycle amplitude at each time bar equally.
3. The autocorrelation is constrained to be between minus one and plus one regardless of the period of the measured cycle period. This obviates the need to compensate for Spectral Dilation of the cycle amplitude as a function of the cycle period.
4. The resolution of the cyclic measurement is inherently high and is independent of any windowing function of the price data.
The dominant cycle is extracted from the spectral estimate in the next block of code using a center-of-gravity (CG) algorithm. The CG algorithm measures the average center of two-dimensional objects. The algorithm computes the average period at which the powers are centered. That is the dominant cycle. The dominant cycle is a value that varies with time. The spectrum values vary between 0 and 1 after being normalized. These values are converted to colors. When the spectrum is greater than 0.5, the colors combine red and yellow, with yellow being the result when spectrum = 1 and red being the result when the spectrum = 0.5. When the spectrum is less than 0.5, the red saturation is decreased, with the result the color is black when spectrum = 0.
Key Signal
DominantCycle --> Dominant Cycle
Period --> Autocorrelation Periodogram Array
Pros and Cons
100% John F. Ehlers definition translation of original work, even variable names are the same. This help readers who would like to use pine to read his book. If you had read his works, then you will be quite familiar with my code style.
Remarks
The 49th script for Blackcat1402 John F. Ehlers Week publication.
Courtesy of @RicardoSantos for RGB functions.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Trend-Range IdentifierTrend trading algorithms fail in ranging market and Swing trading algorithm fail in trending market. Purpose of this indicator is to identify if the instrument is trending or ranging so that you can apply appropriate trading algorithm for the market.
Process:
ATR is calculated based on the input parameter atrLength
Range/Channel containing upLine and downLine is calculated by adding/subtracting atrMultiplier * atr to close price.
This range/channel will remain same until the price breaks either upLine or downLine.
Once price crosses one among upLine and downLine, then new upLine/downLine is calculated based on latest close price.
If price breaks upLine, the trend is considered to be up until the next line break or no lines are broken for rangeLength bars. During this state, candles are colored in lime and upLine/downLine are colored in green.
If price breaks downLine, the trend is considered to be down until the next line break or no lines are broken for rangeLength bars. During this state, candles are colored in orange and upLine/downLine are colored in red.
If close price does not break either upLine or downLine for rangeLength bars, then the instrument is considered to be in range. During this state, candles are colored in silver and upLine/downLine are colored in purple.
In ranging duration, we display one among Keltner Channel, Bollinger Band or Donchian Band as per input parameter : rangeChannel . Other parameters used for calculation are rangeLength and stdDev
I have not fully optimized parameters. Suggestions and feedback welcome.
Dynamic Dots Dashboard (a Cloud/ZLEMA Composite)The purpose of this indicator is to provide an easy-to-read binary dashboard of where the current price is relative to key dynamic supports and resistances. The concept is simple, if a dynamic s/r is currently acting as a resistance, the indicator plots a dot above the histogram in the red box. If a dynamic s/r is acting as support, a dot is plotted in the green box below.
There are some additional features, but the dot graphs are king.
_______________________________________________________________________________________________________________
KEY:
_______________________________________________________________________________________________________________
Currently the dynamic s/r's being used in the dot plots are:
Ichimoku Cloud:
Tenkan (blue)
Kijun (pink)
Senkou A (red)
Senkou B (green)
ZLEMA (Zero Lag Exponential Moving Average)
99 ZLEMA (lavender)
200 ZLEMA (salmon)
You'll see a dashed line through the middle of the resistances section (red) and supports section (green). Cloud indicators are plotted above the dashed line, and ZLEMA's are below.
_______________________________________________________________________________________________________________
How it Works - Visual
_______________________________________________________________________________________________________________
As stated in the intro - if a dynamic s/r is currently above the current price and acting as a resistance, the indicator plots a dot above the histogram in the red box. If a dynamic s/r is acting as support, a dot is plotted in the green box below. Additionally, there is an optional histogram (default is on) that will further visualize this relationship. The histogram is a simple summation of the resistances above and the supports below.
Here's a visual to assist with what that means. This chart includes all of those dynamic s/r's in the dynamic dot dashboard (the on-chart parts are individually added, not part of this tool).
You can see that as a dynamic support is lost, the corresponding dot is moved from the supports section at the bottom (green), to the resistances section at the top (red). The opposite being true as resistances are being overtaken (broken resistances are moved to the support section (red)). You can see that the raw chart is just... a mess. Which kinda of accentuates one of the key goals of this indicator: to get all that dynamic support info without a mess of a chart like that.
_______________________________________________________________________________________________________________
How To Use It
_______________________________________________________________________________________________________________
There are a lot of ways to use this information, but the most notable of which is to detect shifts in the market cycle.
For this example, take a look at the dynamic s/r dots in the resistances category (red background). You can see clearly that there are distinctive blocks of high density dots that have clear beginnings and ends. When we transition from a high density of dots to none in resistances, that means we are flipping them as support and entering a bull cycle. On the other hand, when we go from low density of dots as resistances to high density, we're pivoting to a bear cycle. Easy as that, you can quickly detect when market cycles are beginning or ending.
Alternatively, you can add your preferred linear SR's, fibs, etc. to the chart and quickly glance at the dashboard to gauge how dynamic SR's may be contributing to the risk of your trade.
_______________________________________________________________________________________________________________
Who It's For
_______________________________________________________________________________________________________________
New traders: by looking at dot density alone, you can use Dot Dynamics to spot transitionary phases in market cycles.
Experienced traders: keep your charts clean and the information easy to digest.
Developers: I created this originally as a starting point for more complex algos I'm working on. One algo is reading this dot dashboard and taking a position size relative to the s/r's above and below. Another cloud algo is using the results as inputs to spot good setups.
Colored Bars
There is an option (off by default, shown in the headline image above) to fill the bar colors based on how many dynamic s/r's are above or below the current price. This can make things easier for some users, confusing for others. I defaulted them to off as I don't want colors to confuse the primary value proposition of the indicators, which is the dot heat map. You can turn on colored bars in the settings.
One thing to note with the colored bars: they plot the color purely by the dot densities. Random spikes in the gradient colors (i.e. red to lime or green) can be a useful thing to notice, as they commonly occur at places where the price is bouncing between dynamic s/r's and can indicate a paradigm shift in the market cycle.
_______________________________________________________________________________________________________________
Timeframes and Assets
_______________________________________________________________________________________________________________
This can be used effectively on all assets (stocks, crypto, forex, etc) and all time frames. As always with any indicator, the higher TF's are generally respected more than lower TF's.
Thanks for checking it out! I've been trading crypto for years and am just now beginning to publish my ideas, secret-sauce scripts and handy tools (like this one). If you enjoyed this indicator and would like to see more, a like and a follow is greatly appreciated 😁.
McGinley Dynamic (Improved) - John R. McGinley, Jr.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 inconsistency, but success was not possible until now. Being no stranger to a good old fashioned computational crisis, I revisited it with considerable contemplation.
I discovered a lack of constraints in the formulation that either caused the algorithm to implode to near zero and zero OR it could explosively enlarge to near infinite values during unusual price action volatility conditions, occurring on different time frames. A numeric E-notation in a moving average doesn't mean a stock just shot up in excess of a few quintillion in value from just "10ish" moments ago. Anyone experienced with the usual McGinley Dynamic, has probably encountered this with dynamically dramatic surprises in their chart, destroying it's usability.
Well, I believe I have found an answer to this dilemma of 'susceptibility to miscalculation', to provide what is most likely McGinley's whole hearted intention. It required upgrading the formulation with two constraints applied to it using min/max() functions. Let me explain why below.
When using base numbers with an exponent to the power of four, some miniature numbers smaller than one can numerically collapse to near 0 values, or even 0.0 itself. A denominator of zero will always give any computational device a horribly bad day, not to mention the developer. Let this be an EASY lesson in computational division, I often entertainingly express to others. You have heard the terminology "$#|T happens!🙂" right? In the programming realm, "AnyNumber/0.0 CAN happen!🤪" too, and it happens "A LOT" unexpectedly, even when it's highly improbable. On the other hand, numbers a bit larger than 2 with the power of four can tremendously expand rapidly to the numeric limits of 64-bit processing, generating ginormous spikes on a chart.
The ephemeral presence of one OR both of those potentials now has a combined satisfactory remedy, AND you as TV members now have it, endowed with the ever evolving "Power of Pine". Oh yeah, this one plots from bar_index==0 too. It also has experimental settings tweaks to play with, that may reveal untapped potential of this formulation. This function now has gain of function capabilities, NOT to be confused with viral gain of function enhancements from reckless BSL-4 leaking laboratories that need to be eternally abolished from this planet. Although, I do have hopes this imd() function has the potential to go viral. I believe this improved function may have utility in the future by developers of the TradingView community. You have the source, and use it wisely...
I included an generic ema() plot for a basic comparison, ultimately unveiling some of this algorithm's unique characteristics differing on a variety of time frames. Also another unconstrained function is included to display some the disparities of having no limitations on a divisor in the calculation. I strongly advise against the use of umd() in any published script. There is simply just no reason to even ponder using it. I also included notes in the script to warn against this. It's funny now, but some folks don't always read/understand my advisories... You have been warned!
NOTICE: You have absolute freedom to use this source code any way you see fit within your new Pine projects, and that includes TV themselves. You don't have to ask for my permission to reuse this improved function in your published scripts, simply because I have better things to do than answer requests for the reuse of this simplistic imd() function. Sufficient accreditation regarding this script and compliance with "TV's House Rules" regarding code reuse, is as easy as copying the entire function as is. Fair enough? Good! I have a backlog of "computational crises" to contend with, including another one during the writing of this elaborate description.
When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members, I may implement more ideas when they present themselves as worthy additions. Have a profitable future everyone!
MTF Lag-Less RasterChart (Spectrogram/HeatMap)I present yet another state-of-the-art "MTF Lag-Less RasterChart" employing PSv4.0. Simply describing how this indicator works, the bottom of the indicator pane is most reactive and is highly effective at identifying reversal points quickly once they occur, while the upper portion of the indicator commonly shows enduring trends. This may be my finest multi-timeframe heatmap indicator that I have created so far, complete with multiple stunning gradient color schemes. I'm unsure if I will be able to pack any more tech into these RasterCharts. This may exclude additional algorithms or polychromatics I may discover later on that are worthy of other RasterChart releases. One last thing, this is a companion indicator to my "Lag-Less Rainbow Ribbon" indicator, because the heavily modified base algorithms are nearly identical.
I once again would like to personally thank Dr . John Ehlers for inspiring me to ponder into the realm of heatmap technology and all it has to offer. Your mathemagical splendor is most appreciated! You're a divine inspiration to the algorithmic trading community and forever shall be.
The MTF capabilities include seconds, minutes, and days. If the time frame settings are shorter in time than the current sampling interval, a warning notification will be appropriately displayed. I included a horizontal rule to approximately gauge at what level you may wish to have before entering/exiting a trade upon identifying a trend change. This gizmo functions on all assets on time frames ranging from one second bars up to the "All" chart having monthly bars.
Lastly, I have included so many color scheming techniques that I couldn't demonstrate all of them above. This indicator has what I would term as enhanced "predator" vision. For those of you who have witnessed these movies, you may understand what I have built. This indicator additionally includes a color morphing control to perfectly adjust the gradients to your visual liking, on any time frame whether it be seconds or daily chart preferences. The use of this indicator is just like any of my other RasterCharts or heatmap indicators found on the internet, except it has the greatest versatility I have accomplished as of yet.
Features List Includes:
"Source" selection
MTF controls for seconds, minutes, and days
Adjustable horizontal rule to differentiate between more reactive aspects of turning point fluctuations in the lower portion of the chart (visible above)
Window aperture control
Adjustable heatmap brightness control
Visual color scheme techniques (a few of many are displayed above)
Color gradient morphing
Color inversion control
This is not a freely available indicator, FYI. To witness my Pine poetry in action, properly negotiated requests for unlimited access, per indicator, may ONLY be obtained by direct contact with me using TV's "Private Chats" or by "Message" hidden in my member name above. The comments section below is solely just for commenting and other remarks, ideas, compliments, etc... regarding only this indicator, not others. When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members, I may implement more ideas when they present themselves as worthy additions. As always, "Like" it if you simply just like it with a proper thumbs up, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!
MalphasMalphas is an indicator derived from a Naberius trading algorithm. It detects the current local ranges in the market and prints a suggested entry accordingly at assumed channel tops & bottoms. As such, it excels at trading smaller more volatile timeframes but can, depending on the asset, be effective up to the daily time scales.
This algorithm was developed to trade primarily leveraged XBT; however, after exploring larger alt coins and the more traditional markets outside of cryptocurrency we found that Malphas does better than the average trader regardless of the pair or ticker being traded at the time. Any core changes to the live trading algorithm will be added to this indicator as they are deployed.
Suggested Methods of Operation:
1. Buy and Sell signals represent a possible trading opportunity. Based on our testing, manual traders should use the 15m - 30m for scalping and 60m - 240m or 1D for larger swings.
2. Upon signal print, place your limit orders spread throughout the current candles total body range. DO NOT MARKET IN. DO NOT CHASE. If the limit orders don't fill within the following candle regardless of timeframe being traded remove them and re-evaluate.
3. Malphas excels at trading "chop" aka tight ranging price action on small timeframes and consolidation phases.
4. Use standard candles. Heikin Ashi candles are ok but can be deceiving in times of localized price volatility
5. Trade the highs and lows. Establish the dominate range or channel and trade accordingly.
Mammon v3 StudyMammon is an indicator derived from a Naberius trading algorithm. It detects the current trend in the market and prints a suggested entry accordingly at assumed pivot points. As such, it excels at trading larger timeframes but can, depending on the asset, be effective down to the 15m and 30m time scales.
This algorithm was developed to trade primarily leveraged XBT; however, after exploring larger alt coins and the more traditional markets outside of cryptocurrency we found that Mammon does better than the average trader regardless of the pair or ticker being traded at the time. Any core changes to the live trading algorithm will be added to this indicator as they are deployed.
Suggested Methods of Operation:
1. Buy and Sell signals represent a possible trading opportunity. Based on our testing, manual traders should use the 30-60m for scalping and 240m and 1D for larger swings.
2. Upon signal print, place your limit orders spread throughout the current candles total body range. DO NOT MARKET IN. DO NOT CHASE. If the limit orders don't fill within the following candle regardless of timeframe being traded remove them and re-evaluate.
3. Mammon can be susceptible to "chop" aka tight ranging price action on small timeframes. If a Buy prints at the current resistance or Sell prints at current support it's best to not take that position or wait for volume confirmation before entering.
4. Use standard candles. Heikin Ashi candles are ok but can be deceiving in times of localized price volatility
5. Trade the trend. Establish the dominate direction then trade accordingly.
YK_28CRYPTO_Custom_RSICustom RSI over EMA
22/11 Crossover
Financial Interpretation: The Relative Strength Index is useful for detecting Movement which is not readily apparent, and also as a Reversal signal using Divergence between the RSI and price (an RSI above 70 or below 30 warns of coming reversals). The Relative Strength Index is smoother than the Rate of Change.
Calculation: The Relative Strength index is calculated using following algorithm:
1. Average Upward Price Move = EMA( Sum of all upward movements in Closing price )
2. Average Downward Price Move = EMA( Sum of all downward movements in Closing price )
3. Calculate Relative Strength (RS):
RS = Average Upward Price Move / Average Downward Price Move
4. Calculate the Relative Strength Index (RSI):
RSI = 100 - 100 / ( 1 + RS )
It warns of coming reversal convergence/divergence combined with Heiken Ashi
Breakfree Trading | DiscoveryThe Breakfree Trading Algorithm works by analyzing the market structure of an asset. A mathematical model is used to map out resistance and support zones as well as decode the psychological levels developed in the market.
Our algorithm works by spotting high probability trades and creating signals which indicate where you should enter the trade, take profits, or set the stoploss. However, the secret sauce is how trades are executed in those zones. The results vary depending on the market.
Follow the instruction on our website linked in the signature area or my profile to gain access to this algorithm.
Author: KTAS
Written by: Asger Emborg
Date: 1-November-2019
Version: v2.1.0 Discovery Public Release Nov-2019
-----------------------------------------------------------------------------
Copyright 2019 Breakfree Trading // Beige Holdings LLP
-----------------------------------------------------------------------------