Channels indicators are widely used in technical analysis, they provide lot of information. In general, technical indicators giving upper/lower extremities are calculated by adding/subtracting a volatility component to a central tendency estimator. This is the case with Bollinger bands, using the rolling standard deviation as volatility estimator and the simple moving average as central tendency estimator, or the Keltner channels using the exponential moving average and the average true range.
Lots and lots and lots of those indicators have been made, they only really need a central tendency estimator, which can be obtained from pretty much any filter, however i find interesting to focus on the efficiency of those indicators, therefore i propose a super efficient channel indicator using recursion. The average resulting from the upper/lower extremity of the indicator provide a new efficient filter similar to the average highest/lowest.
The calculation – How Does It Works:
Efficiency is often associated to recursion, this would allow us to use past output values as input, so how does the indicator is calculated? Lets look at the upper band calculation :
a = max(src,(a)) – (a – b)/length
src is the closing price, a is upper extremity, b is the lower one. Here we only need 3 values, the previous values of a and b and the closing price. Basically a = max(src,a) mean :
if the closing price is greater than the precedent value of a then output the closing price, else output the precedent value of a
therefore a will never be inferior to its precedent value, this is useful for getting the maximum price value in our dataset however its not useful to make an upper band, therefore we subtract this to a correction factor defined as the difference between a and b, this force the upper band to have lower values thus acting like a band without loosing its “upper” property, a similar process is done with the lower band.
Of course we could only use 2 values for making the indicator, thus ending with :
a = max(src,a) – (abs(close – a)/length
(description from original author: alexgrover)
//PRC_G-Channel | indicator
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//original author: alexgrover
//--- end of settings
once a = high
once b = low
if barindex>length then
a = max(customclose,(a)) - (a - b)/length
b = min(customclose,(b)) + (a - b)/length
avg = (a+b)/2
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :