GG ATR bands
ATR plotted above and below price with a multiplier. Defaults to 2x ATR. Makes it easier to use ATR for stop or take profit.
Bands
Self-Adjusting RSI +Here is an open source (no request needed!) version of the Self-Adjusting RSI by David Sepiashvili.
Published in Stocks & Commodities V. 24:2 (February, 2006): The Self-Adjusting RSI
David Sepiashvili's article, "The Self-Adjusting RSI," presents a technique to adjust the traditional RSI overbought and oversold thresholds so as to ensure that 70-80% of RSI values lie between the two thresholds. Sepiashvili presents two algorithms for adjusting the thresholds. One is based on standard deviation, the other on a simple moving average of the RSI.
This script allows you to choose between plotting the Self-Adjusting bands or the traditional bands. You can also plot a smoothed RSI (SMA or EMA) and change the theme color for dark or light charts.
If you find this code useful, please pass it forward by sharing open source!
Thank you to all of the open source heroes out there!
"If I have seen a little further it is by standing on the shoulders of Giants."
Volatility Adjusted Bands - JD This indicator gives a likely trading range based on the volatility of the past x amount of bars, measured against a certain moving average.
The indicator can be used as an alternative for BBands.
It gives approx. the same "trend-side" lines (upper line in uptrend, lower line in down trend) as the Bollinger Bands, but the opposite line follows closer on price,
Instead of "flying out" to the other direction like in BBands.
As a comparison, the BBands for the same length (50 period) are added on the chart.
JD.
#NotTradingAdvice #DYOR
I build these indicators for myself and provide them open source, to use for free to use and improve upon,
as I believe the best way to learn is toghether.
Auto-Dispersion BandsIntroduction
A really old indicator as well, thus i have no much ideas of what is going on with it, but i know that those bands returns good reversals points. The indicator don't use standard deviation, instead its a simple differencing of the price and the price length bars back who will provide a dispersion measurement, thus the name auto-dispersion.
The Indicator
The smooth parameter allow the band to cross the price, if smooth is low the chance of crosses are lower.
smooth = 3
Volume Adaptive BandsIntroduction
I have been asked by @Coppermine and @Verbena to make bands that use volume to provide adaptive results. My first approach was to use exponential averaging, in order to do so i needed to quantify volume movement using rescaling with the objective to make the bands go away from each others when there is low volume, this approach is efficient and can work on any time frame, however i decided at the end to use another method which rely on recursive weighting, cleaner but more parametric. Those bands aim to highlight great breakouts point to go with the trend.
The Indicator
length control the period of the moving averages used in the script, however low length's don't necessarily provide indications for shorter terms breakouts as shown here :
As i said the bands are close to each others when there is high volume and away when there is low volumes.
Low volume period, bands will avoid to cross price
High volume, bands will be close to generate signals.
Correction Factor
Higher time frames will lower the distance between each band, this is because volume is higher during higher time frames, remember that the indicator bands are close to each others when volume is high.
1h chart eurusd.
This is why i added a correction factor, this factor can help you control the distance between each bands, when the correction factor is greater than 1 the bands will be closer to each others, this is useful for low time frames where the average volume is lower. When the time frame is high, use values between 0 and 1 to increase distance between each bands.
Correction factor = 0.2
Conclusion
I presented a new adaptive band indicator that adapt to trading volume by using recursive weighting, volume can be replaced by other indicators but you can have results going nuts, at the end its about experimentation. I hope you will find an use to it, thanks to @Coppermine and @Verbena for the request :)
Thanks for reading !
Pseudo Polynomial ChannelIntroduction
Back when i started using pine i made a script called periodic channel who aimed to rescale an average correlated sine wave to the price...don't worked very well. So i tried to fix problems induced by the indicator without much success, i had to redo it from scratch while abandoning the idea of rescaling correlated smooth functions to the price, at that time i also received requests regarding polynomial channel, some plateformes included this indicator, this led me to the idea to estimate it in order to both respond to the periodic channel problems and the requests i received, i have tried many many things and recently i tweaked a linear extrapolation to have an approximation.
Linear Extrapolation To Pseudo Polynomial Regression
I could be wrong but a polynomial regression must use constant parameters in order to provide a really smooth output, at least constant for a set of time. The moving averages forms (Savitzky-Golay moving average) who smooth polynomials across a window to the data don't have such smoothness, so how to estimate a polynomial regression while having a parameter providing control over the smoothness, a response to this is by using a recursive linear extrapolation. I posted a linear extrapolation indicator long ago, i used the same formula while adding a function to morph the output and the input in the form of :
morph * output + (1-morph) * input
How can this provide an estimate of a polynomial regression ? Well i'm not even sure myself but if you use the output as input (morph = 1) for the linear extrapolation function you should get a rough estimate of a line, this is what i thought at first and it proved to be right
Based on this observation i thought that it would be possible to get polynomial results by lowering morph, and as expected it worked well but showed a periodic pattern, this is why i smooth k in line 10.
0.9 for morph work well, higher values create sometimes smoother results but damage heavily the estimation.
Parameters
Morph have been introduced earlier, it control the amount of output and input the linear extrapolation should process, lower values create rougher but more stables results, if you see that the estimation is going nuts lower morph or change length, also lower length if you increase morph .
High overshoot, morph to 0.8 can help have a better estimation at the cost of less smoothness.
Length control the indicator smoothing, this parameter differ heavily from other filters, therefore low values can create mid/long term smoothing, it can also depend on which market instrument you are applying it, so there are no fixed optimal length.
Mult control how spread the bands are, to do so mult multiply the cumulative mean error, you can change this error measurement by anything you want like standard deviation/atr/range but take into account that you may create a separate parameter to control the error instead of length . Mult can be a float and like length can have different optimal values depending on the market the indicator is applied to.
Flatten do exactly what is name imply, it flatten the overall output to have a better estimation, can be a float. The result is less smooth.
Flatten = 2
More Exemples
BTCUSD length = 25 and mult = 4
XPDUSD length = 25 and mult = 1
ALPHABET length = 6 and morph = 0.99
Conclusion
I tried to estimate a polynomial channel by using recursion in the linear extrapolation function. This build is way more stable than the periodic channel but its still a bit inaccurate in my opinion. I hope this code can still help someone build something really nice, if so share your results :)
I apologize for those expecting a legit polynomial channel build but i really don't know how to do that, as i said parameters for the regression must be constants, i hope it still fine :)
Thanks for reading !
ATR BandsDisplays two bands above and below the source using the ATR. Comes with ATR multipliers for upper and lower bands.
Flagging BandsIntroduction
A pun between the word flag and the adjective flagging (less dynamic) , this indicator have two bands who react faster when in contact to the price. Imagine you are under sheets, if you abruptly rise, the sheets will instantaneously go up, then if you abruptly get down, the sheets will fall slowly until being in contact with a surface, this is because of a type of friction called drag or air resistance , this force is described in fluid dynamics and i inspired myself from that for the creation of the indicator.
The indicator
The indicator is made of two bands, one upper band and one lower band, then a weighted average of each bands, this average is weighted depending on which band the price is closer. The length control the period of the indicator, in general higher lengths will create wider bands, you must consider that this parameter behave differently than other ones and may create slower results in comparison with other bands indicators while having the same length period.
The indicator can use a simple breakout methodology (see trailing stop part) but can sometime provide support and resistance points, in fact i believe that when the average variability/volatility of band A is higher than the average variability/volatility of band B and that the price cross band B then price will reverse its direction, this claim is not justified, research is needed.
Trailing Stop Mod
It is possible to make the indicator act as a trailing stop, in order to do so just tick the trailing stop mod box.
The average/bands will automatically disappear being replaced by the trailing stop.
Conclusion
I was just playing around when making the skeleton of the indicator, i hope the code is easy to understand, if you need some kind of explanation just pm me, i'm always open to help people/receive suggestions.
Best Regards
Motion To Attraction ChannelsIntroduction
Channels are used a lot on technical-analysis, however most of the them rely on adding/subtracting a volatility indicator to a central tendency indicator, sometimes the central tendency indicator can even be replaced by pure price. A great channel who does not rely on this kind of architecture is the Donchian channels or the quartiles bands. Here i propose a channel similar to the one made by Richard Donchian with some additional abilities.
The Channels
In my indicator, Motion To Attraction mean that the movement of an object a attract an object b , but we can resume this approach by saying that the longer a trend period is, the smaller the distance between each channels, for example if the price create a new highest then the lowest will move toward this new highest, each time coming closer. The philosophy behind this is that the longer a trend is the more probable it is that she will end.
The code reflect it this way :
here the parameter controlling the channel A (upper)
c = change(b) ? nz(c ) + alpha : change(a) ? 0 : nz(c )
this is traduced by : if channel b move then the parameter c become greater, if channel a move then reset the parameter , the parameter d do the same.
c is used to move the channel A, when c < 1 A is closer to the highest, when c = 1 A is in a central tendency point, when c > 1 A is closer to the lowest.
Slaving the Movement
It is possible to have a better control over the channels, this is done by making c and d always equal or lower than 1. Of course it could be another max value selected by the user.
In order to do that add c1 and d1 as parameter with c1 = c > 1 ? 1 : c , same with d1 but replace c by d.
Its safer to do this but i prefer how the channels act the other way, i will consider implementing this option in the future.
Conclusion
This channel indicator does not rely on past data thanks to recursion. The alpha variable at the start can also be adaptive, this let you make the channels adaptive even if such idea can add non desired results. Low length values can create effects where the lower channel can be greater than the higher one, this can be fixed directly in the code or using the method highlighted in the Slaving the Movement part.
McNicholl Moving AverageThis type of moving average was originally developed by Dennis McNicholl (Futures Magazine, (October, 1998): "Better Bollinger Bands"). A kind of TEMA. He used it as a centerline of the new bands, called Better Bollinger Bands or DEnvelope. The Better Bollinger Bands is a modification of the well-known Bollinger Bands that has a better response for changes in volatility.
RSI ATR ChannelDraws a channel based on ATR (Average True Range) and RSI. Detects band touches and colors the background appropriately.
Kirshenbaum BandsThis indicator was originally developed by Paul Kirshenbaum, a mathematician with a Ph.D. in economics from New York University.
It uses the standard error of linear regression lines of the closing price to determine band width. This has the effect of measuring volatility around the current trend, rather than measuring volatility for changes in trend.
Good luck!
Relative Strength Volatility Variable Bands [DW]This is an experimental adaptive trend following study inspired by Giorgos Siligardos's Reverse Engineering RSI and Tushar S. Chande's Variable Moving Average.
In this study, reverse engineered RSI levels are calculated and used to generate a volatility index for VMA calculation.
First, price levels are calculated for when RSI will equal 70 and 30. The difference between the levels is taken and normalized to create the volatility index.
Next, an initial VMA is calculated using the created volatility index. The moving average is an exponential calculation that adjusts the sampling length as volatility changes.
Then, upper and lower VMAs are calculated by taking a VMA of prices above and below the initial VMA. The midline is produced by taking the median of the upper and lower VMAs.
Lastly, the band levels are calculated by multiplying the distance from the midline to the upper and lower VMAs by 1, 2, 3, 4, and 5.
Bar colors are included. They're based on the midline trend and price action relative to the upper and lower VMAs.
Bollinger Bands MTF [LonesomeTheBlue]With this script you can follow Bollinger Bands for current and higher time frame together. Higher time frame is calculated by script.
if current period
1m => higher period=5m
3m => higher period=5m
5m => higher period=15m
15m => higher period=1h
30m => higher period=1h
45m => higher period=1h
1h => higher period=4h
2h => higher period=4h
3h => higher period=4h
4h => higher period=1day
1day => higher period=1week
Tripple BB_13EMAHere is a script to use 3 types of Bollinger Bands.
It is like three resistances or ranges in wich the Chart generally likes to move. A 1, 2 and 3 Width BB. The Chart moves 90% between the yellow one.
As support for my study i use the 13 EMA. is the Chart over the 13 EMA and under the Yellow (2) BB the trend is bullish. Is t under the 13 EMA and over the Yellow BB the trend used to be bearish.
The opener the BB are the more Volatilaty and the more likely the Chart will not bounce against the Bands. It will more get stick to the yellow or red one (if it is between them it is a trend too) and will follow up or downwards.
Check it out
Percentage Band Indicator I added alerts in my Percentage Band strategy
You can see the strategy and backtest here
You can look at my other scripts.
www.tradingview.com
Trend Trader Bands Strategy This is plots the indicator developed by Andrew Abraham
in the Trading the Trend article of TASC September 1998
It was modified, result values wass averages.
And draw two bands above and below TT line.