peregringlk

Simplest volatility bands

peregringlk 已更新   
Volatility bands based on average candle percentage spread. Tested on BTCUSD charts only.

Based on the 68-95-99.7 rule, it seems that the spread, for daily and 4-H candles, follows a normal distribution: that means, around 85% of candles have a %-spread within sma(low/high, some_len) and sma(high/low, some_len), and around 95% of candles within the pow2 of that range.

If you take the mean between the boundaries of the first %-spreads band, and calculate the 1.5 standard deviation of past some_len candles (I'm speaking from memory, it has been a while since I did them), the 1.5 standard deviation bands match similarly the %-spread bands, and around 85% of the candles are within these %-spread bands.

If you then take the pow2 of the bands, it will be similar to the 2 * std of the original bands, with around 95% of data within the pow2 bands.

You can take ema or other similar means with similar results, and the same for different lengths, but it seems that sma with a len of 14 is the more stable ones for both daily and 4-H, and taken other average calculations doesn't cause too many differences respect to the sma. I haven't tested too much for lower or higher timeframes.

With those %-spread bands, I multiple and divide those spreads to the open value of a new candle to get the two bands.

So, in short, you know that 85% of candles are within the closer bands, and around 95% of candles, around the bigger one. Once a new candle is born, the bands won't move (the bands are calculated from the previous candle, so the current candle's price movement doesn't move the band).

Going out the bands implies a sudden increase in volality, which usually causes rejection. They happen mostly at breakouts and ends of heavy trends. If a candle closes above the bigger band, you have probably got a breakout (a rejection rarely happens if the candle have already closed), although a breakout can happen without closing above the bands if volatility was already high.

If a trend is already stablished and is healthy, you won't probably see candles going out the bands, not even with a wick. When the trend is parabolic, and goes above the candle, the trend has probably ended, although the trend can be exhausted without going out the bands as well.

Heavy but not yet exhausted trends (specially recently started heavy downtrends), usually reach the bottom of the bigger bands during 4 o 5 contiguous candles (check visually looking at bitcoin history though, I'm speaking from memory).

So, the possibilities are multiple and you cannot use the bands to form a strategy, as usual. It can be comfortable enough psycologically for going to sleep, by moving your stop-loss to a point out of the bands in the opposite direction of your trade, and adjusting your position size accordingly; or just to check momentum looking at how close are the candle limits to the bands.

But, as usual, you are responsible of what you do with your money :)
版本注释:
Volatility bands based on average candle percentage spread. Tested on BTCUSD charts only. If we are in a 4-H chart, we additionally plot the daily bands.

Based on the 68-95-99.7 rule, it seems that the spread, for daily and 4-H candles, follows a normal distribution: that means, around 85% of candles have a %-spread within sma(low/high, some_len) and sma(high/low, some_len), and around 95% of candles within the pow2 of that range.

If you take the mean between the boundaries of the first %-spreads band, and calculate the 1.5 standard deviation of past some_len candles (I'm speaking from memory, it has been a while since I did them), the 1.5 standard deviation bands match similarly the %-spread bands, and around 85% of the candles are within these %-spread bands.

If you then take the pow2 of the bands, it will be similar to the 2 * std of the original bands, with around 95% of data within the pow2 bands.

You can take ema or other similar means with similar results, and the same for different lengths, but it seems that sma with a len of 14 is the more stable ones for both daily and 4-H, and taken other average calculations doesn't cause too many differences respect to the sma . I haven't tested too much for lower or higher timeframes.

With those %-spread bands, I multiple and divide those spreads to the open value of a new candle to get the two bands.

So, in short, you know that 85% of candles are within the closer bands, and around 95% of candles, around the bigger one. Once a new candle is born, the bands won't move (the bands are calculated from the previous candle, so the current candle's price movement doesn't move the band).

Going out the bands implies a sudden increase in volality, which usually causes rejection. They happen mostly at breakouts and ends of heavy trends. If a candle closes above the bigger band, you have probably got a breakout (a rejection rarely happens if the candle have already closed), although a breakout can happen without closing above the bands if volatility was already high.

If a trend is already stablished and is healthy, you won't probably see candles going out the bands, not even with a wick. When the trend is parabolic, and goes above the candle, the trend has probably ended, although the trend can be exhausted without going out the bands as well.

Heavy but not yet exhausted trends (specially recently started heavy downtrends), usually reach the bottom of the bigger bands during 4 o 5 contiguous candles (check visually looking at bitcoin history though, I'm speaking from memory).

So, the possibilities are multiple and you cannot use the bands to form a strategy, as usual. It can be comfortable enough psycologically for going to sleep, by moving your stop-loss to a point out of the bands in the opposite direction of your trade, and adjusting your position size accordingly; or just to check momentum looking at how close are the candle limits to the bands.

But, as usual, you are responsible of what you do with your money :)
版本注释:
Added correct lookahead (on), to correctly plot the daily bands when the current timeframe is 4-H.
版本注释:
Moved to version 4 and added an open source clause.
版本注释:
Cosmetic changes.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?