Bands
Bands-Trailing Stop UtilityIntroduction
Bands and trailing stops are important indicators in technical analysis, while we could think that both are different they can be in fact closely related, at least in the way they are made. Bands and trailing stops can be made from a simple central tendency estimator, like a moving average, and from a volatility estimator like standard deviation, atr...etc.
This is why i propose this utility that allow you to make bands and trailing stops from any indicator in the price chart.
How To Use
All you have to do is select the indicator you want to make bands from in the settings, so just open the Bands-Trailing Stop Utility indicator settings and select your indicator in "Source". Make sure your source indicator is not in "hide" mode.
For example here i'am using a moving average as source for the indicator. Mult control how spread the bands are from each others, by default mult = 1, if we use mult = 2 we get :
Mult can be non-integer as well as lower than 1 (when lower than 1 the bands would be closer to each others)
Error/Volatility Estimators
You can choose from a wide variety of volatility estimators, select the estimator from the "Method" scrolling parameter in settings, by default the indicator will use the running mean absolute error (MAE) which don't use length. Other estimators use length, making length = to the period of the source indicator can help get better results.
The root moving averaged squared error (RMASE) is just the square root of the simple moving average of the squared difference between the closing price and the source indicator. length control the period of the moving average of RMASE.
You can also use the average true range with period length. It might work better with low lagging moving averages.
The range is simply the difference between the highest and lowest over length periods of the source indicator.
Stdev is simply the price running standard deviation.
Trailing Stop
When the trailing stop mode is checked the bands will be replaced by a trailing stop, the trailing stop will still depend on every settings of the indicator like mult/volatility estimator...etc.
Conclusion
You might find an use to this tool if you want to make bands/trailing stops from pretty much everything. The indicator used as source for the examples is a smooth exponential averager that i could share if i see interest from peoples.
Thanks for reading !
Global Market Signals: Percent BandsWelcome!
Thanks for checking out my indicator. This is a simple indicator that plots "x" percent above and below the price.
You can select Open, High, Low, Close as the price.
Hope this helps,
Andre
Global Market Signals
Options - Kaufman / LEAST SQUARES Moving AverageThis is a combo of multiple indicators :
1- three kama moving averages
2- one lsma moving average
3- a kama upper and lower band that you can set to use any of the three kama moving averages in the indicator as source
4- upper, lower and center bollinger bands price for last candle
The horizontal dot line is the bollinger and the horizontal arrowed lines are the bands for kama indicator.
The parameters are available for KAMA, LSMA and BB settings, the default settings are prefabricated for options trading.
Kaufman Adaptive BandsIntroduction
Bands are quite efficient in technical analysis, they can provide support and resistance levels, provide breakouts points, trailing stop loss/take profits positions and can show the current market volatility to the user. Most of the time bands are made from a central tendency estimator like a moving average plus/minus a volatility indicator. Therefore bands can be made out of pretty much everything thus allowing for any kind of flavors.
So i propose a band indicator made from a Kaufman adaptive moving average using an estimate of the standard deviation.
Construction
The Kaufman moving average is an exponential averager using the efficiency ratio as smoothing variable, length control the period of kama and in order to provide more smoothness a power parameter has been introduced, higher values of power will return smoother results.
The volatility indicator is made from a biased estimation of the standard deviation by using the square root of the mean of the square minus the square of the mean method, except that we use kama instead of a mean.
The bands are made by adding/subtracting this volatility indicator with kama.
How To Use
The ability of the indicator to adapt to the current market state is what makes him a great tool for avoiding major exposition during ranging market, therefore the indicator will have a greater motion during trending market, or more simply the bands will move during trending markets while staying "flat" during ranging ones. Therefore the indicator might be more suited to breakouts, even if some cases will return what where turning points, this is particularly true during ranging markets.
Of course the efficiency ratio is not an "unbiased" trend metric indicator, it can consider high volatility markets as trending markets. Its one of his downsides.
High values of power will create smoother bands.
When using a low power parameter use an higher mult. In general using a low power value will make the bands move more freely as well as making them closer to each others.
Conclusion
At least the indicator is really nice to the eyes when using high power values, its ability to adapt to the market is a great addition to other more classical bands indicators, i also introduced a volatility estimator based on kama, some might have used the following estimation : kama(abs(price - kama)) which would have created a slower result. A trailing stop might be made from it if i see request about such addition.
If you are curious here are some more images of the indicator performing on different markets. Thanks for reading !
Cold 𝕃𝔼𝔾𝕆MA Ribbon
An Attempt For Smoother trend
Optional next candle forecaster for ma and its signal
Optional MA from coloring experimentation
Triangular Moving Average (TMA) bandsWhat in the world is up folks ??!??
Here's the indicator of the day. Sharing a simple one today because I'm busy coding for a few clients (fun life of a top script author on TradingView)
The TMA bands is an indicator that I discovered on FXCM a few years ago FXCM TMA bands
From the screenshot above, we see that when the price hits the lower band, it's a possible reverse BUY signal. When it hits the upper band, it's a possible SELL signal
Methodology
1) The Take Profit 1 is the middle line, Take Profit 2 is the opposite band.
2) Once the TP1 is hit, set your Stop Loss to breakeven
3) Once the TP2 is hit, if you still want to stay in the trade, set your Stop Loss to the TP1
That's what we call a trailing stop loss which I offered in the Trade Manager : Trade-Manager-Open-Source-Version/
It will be a powerful tool in your arsenal for some scalp/intraday trades
After years of coding for traders, I worked with many brokers/API/languages so I'm very used to convert a script from a broker to another one (shameless self-advertising)
PS
Tomorrow I'll share the Signal version of my Algorithm Builder:
You'll be able to connect it in a single click to a very cool Backtest System made by the Pinescripters community
In other words, I'm selling the scripts to allow you to build your own signals in a few clicks AND to connect it easily to a kick-ass backtesting tool. More to come tomorrow
Hope you'll like it, like me, love it, love me, tip me :)
____________________________________________________________
Feel free to hit the thumbs up as it shows me that I'm not doing this for nothing and will motivate to deliver more quality content in the future. (Meaning... a few likes only = no indicators = Dave enjoying the beach)
- I'm an officially approved PineEditor/LUA/MT4 approved mentor on codementor. You can request a coaching with me if you want and I'll teach you how to build kick-ass indicators and strategies
Jump on a 1 to 1 coaching with me
- You can also hire for a custom dev of your indicator/strategy/bot/chrome extension/python
VWAP BandsThis indicator plots distant VWAP lines that serve as support and resistance. You can add more lines from the script.
Good trades!
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.
KAMA - Enky v1.22New version with some fixes and the possibility to show the KAMA efficiency ratio ER. Add another istance of the indicator, move it in a new tradingview pane, turn off SHOW KAMA 1 and turn on SHOW ER RATIO
Adaptive BB Triple Layer Adaptive BB SD
Band based pullback and pivoting signals ♘♝
Macro Trend sentiment - Outer deviations coloring
Micro trend - Mean Value and normal +/- st.dev colors
Candle Colors - Median Trend
Col Coded Primitive(Basic) Squeeze detection
Sensitive micro break out/down signals derived from basic Mean line crossing (Added some Whipsaw Protection)
Basic Squeeze
Extreme deviations can be turned off for "compact" view
Basic break out/down signals
Indicator needs TESTING
Signal sensitivity and trend recognition need testing/tuning before even considering to use this BB for trading purposes
Volatility BandsWe used Marc Chaikin’s Chaikin Volatility as somewhat of a baseline for this indicator and then built on it. Like Chaikin Volatility, our indicator draws primarily upon high-low spreads to quantify a security’s volatility. It also has similarities to Keltner Channels as it uses ATR rather than standard deviations in its calculation of the different bands.
Inputs:
int ‘len0’, lookback window for fast EMA of high-low ranges.
int ‘len1’, lookback window for slow EMA of high-low ranges.
int ‘len2’, lookback window for slow EMA of closing prices.
float ‘m0’, ATR multiplier for first upper and lower volatility bands.
float ‘m1’, ATR multiplier for second upper and lower volatility bands.
float ‘m2’, ATR multiplier for third upper and lower volatility bands.
int ‘lenATR’, window length for ATR calculation.
Output: 3 Upper and Lower Volatility Bands (6 total).
1. Compute High Low Spread for current period.
hlr = (high – low)
2. Calculate Exponential Moving Average of HLR at length len0
fastEMA = ema(hlr, len0)
3. Calculate Exponential Moving average of HLR at length len1 (where len1 > len0)
slowEMA = ema(hlr, len1)
4. Get EMA of closing prices at length len2(where len2 > len1 and len1 > len0)
priceEMA = ema(close, len2)
5. Use adjusted Chaikin Volatility Formula to quantify volatility
v = (fastEMA – slowEMA) / slowEMA
6. Calculate three upper and three lower volatility bands (6 total):
ex:
upper0 = priceEMA + ((1 – cv) * (atrMult0 * atr(lenATR)))
lower0 = priceEMA – ((1 – cv) * (atrMult0 * atr(lenATR)))
One possible way to use this indicator is to enter a long position when the security’s price falls below the lowest volatility band and then exit when it crosses above the third upper band. This seems to get the best results for quick, high frequency trading. Another approach is to enter a position when the bands begin to break out from a compact state and the width between them increases.
Still tweaking the idea, so any feedback would be appreciated.
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."
Moving Averages + VWAPA moving average (MA) is a widely used indicator in technical analysis that helps smooth out price action by filtering out the “noise” from random short-term price fluctuations. It is a trend-following, or lagging, indicator because it is based on past prices.
The two basic and commonly used moving averages are the simple moving average (SMA), which is the simple average of a security over a defined number of time periods, and the exponential moving average (EMA), which gives greater weight to more recent prices.
The most common applications of moving averages are to identify the trend direction and to determine support and resistance levels.
Script includes
4 EMA
5 EMA
8 EMA
9 EMA
13 EMA
20 EMA
20 SMA
21 EMA
34 EMA
50 EMA
50 SMA
55 EMA
200 SMA
The volume weighted average price (VWAP) is a trading benchmark used by traders that gives the average price a security has traded at throughout the day, based on both volume and price. It is important because it provides traders with insight into both the trend and value of a security.
VWAP + VWAP bands
Self-Adjusting RSIThis indicator was originally developed by David Sepiashvili (Stocks & Commodities V. 24:2 (February, 2006): The Self-Adjusting RSI ).
The author presented 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.
He used two algorithms for adjusting:
Standard Deviation-based
Simple Moving Average-based
Easy and straightforward. But this is not a true way.
Source code on request
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.
Volume (Incremental) Weighted VOLATILITY BANDSDISCLAIMER:
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 following indicator was made for NON LUCRATIVE ACTIVITIES and must remain as is following TradingView's regulations. Use of indicator and their code are published by Invitation Only for work and knowledge sharing. All access granted over it, their use, copy or re-use should mention authorship(s) and origin(s).
WARNING NOTICE!
THE INCLUDED FUNCTION MUST BE CONSIDERED AS TESTING. The models included in the indicator have been taken from openly sources on the web, problems could occur at diverse data sceneries.
WHAT'S THIS...?
Work derived by previous own research for study:
The given indicator is another VWAP analysis tool that contains openly procedures for rolling out time sessions as in other TradingView scripts .
Some novelties are introduced in this version:
INCREMENTAL WEIGHTED STANDARD DEVIATION BANDS: The calculation on this script are strictly based in regard of University of Cambridge Computing Service, February 2009 paper by Tony Finch publicly found at people.ds.cam.ac.uk .
From the Abstract, he explain how to derive formulae for numerically stable calculation of the mean and standard deviation, which are also suitable for incremental on-line calculation. Then he generalize these formulae to weighted means and standard deviations. He unpick the difficulties that arise when generalizing further to normalized weights. Finally he shown that the exponentially weighted moving average is a special case of the incremental normalized weighted mean formula, and derive a formula for the exponentially weighted moving standard deviation.
VOLUME WEIGHTED VOLATILITY ADAPTIVE MOVING AVERAGE & BANDS: Taking the INCREMENTAL WEIGHTED STANDARD DEVIATION already described and taking a specified anchor or Rolling procedure for a VWAP, I derive the variance against the price to use it as VOLATILITY PROXY for a normalization lambda to plot a First Order Impulse Response Filter or Adaptive Average . This idea have it's roots derived from Chaiyuth Padungsaksawasdi & Robert T. Daigler paper entitled "Volume weighted volatility: empirical evidence for a new realised volatility measure".
NOTES:
This version DO NOT INCLUDE ALERTS.
This version DO NOT INCLUDE STRATEGY: Feedback are welcome.
DERIVED WORK:
Incremental calculation of weighted mean and variance by Tony Finch (fanf2@cam.ac.uk) (dot@dotat.at), 2009.
Volume weighted volatility: empirical evidence for a new realised volatility measure by Chaiyuth Padungsaksawasdi & Robert T. Daigler, 2018.
Multi-Timeframe VWAP by TradingView user @mortdiggidi
CHEERS!
@XeL_Arjona 2019.
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 !