* We must first start by calculating a rolling measure based on the average between the highest high and the lowest low in the last specified lookback window. This will give us a type of moving average that tracks the market price. The specificity here is that when the market does not make higher highs nor lower lows, the line will be flat. A flat line can also be thought of as a magnet of the price as the ranging property could hint to a further sideways movement.
* The K’s bands assume the worst with and thus will take the maximum for a given lookback period. Unlike the which will take the latest calculation every single step of time, K’s bands will suppose that we must be protected by the maximum of for that period which will give us from time to time stable levels.
Therefore, the difference between the and K's bands are as follows:
* Bands' formula calculates a on the closing prices while K's bands' formula calculates the average of the highest highs and the lowest lows.
* Bands' formula calculates a simple standard deviation on the closing prices while K's bands' formula calculates the highest standard deviation for the lookback period.
Applying the bands is similar to applying any other bands. We can list the typical strategies below:
* The range play strategy: This is the usual reversal strategy where we buy whenever the price hits the lower band and sell short whenever it hits the upper band.
* The band re-entry strategy: This strategy awaits the confirmation that the price has recognized the band and has shaped a reaction around it and has reintegrated the whole . It may be slightly lagging in nature but it may filter out bad trades.
* Following the trend strategy: This is a controversial strategy that is the opposite of the first one. It assumes that whenever the upper band is surpassed, a buy signal is generated and whenever the lower band is broken, a sell signal is generated.
* Combination with other indicators: The bands can be combined with other technical indicators such as the in order to have more confirmation. This is however no guarantee that the signals will improve in quality.
* Specific strategy on K’s bands: This one is similar to the first range play strategy but it adds the extra filter where the trade has a higher conviction if the is flat. The reason for this is that a flat line means that no higher highs nor lower lows have been made and therefore, we may be in a sideways market which is a fertile ground for mean-reversion strategies.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.