# G-Channels – Efficient Calculation Of Upper/Lower Extremities

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[1])) – (a[1] – b[1])/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[1]) 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[1]) – (abs(close – a[1])/length

(description from original author: alexgrover)

Risk disclosure:

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 : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

1. • 221 days ago #

I really like it when you develop ideas around price movement! I am much less a fan of all the indicators calculated with averages of this or that, too subjective in my opinion!

Register or

#### Likes

Related users ' posts
Iván
4 days ago
1
Indicators
Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
Iván
2 weeks ago
2
Indicators
Cuando te descargas el fichero itf, en su código no aparece toda la configuración de alertas...
Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
Iván
3 weeks ago
3
Indicators
Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
i love it !!! thanks.
:)
Iván
3 weeks ago
8
Indicators
Hi Ivan, can you translate from tradingviwe the EMA TREND METER INDICATOR? It couid be inte...
Hi Yes I can. Please, create a new topic for that I will translate it.
Hi Ivan, I've created a new topic about the indicator: https://www.prorealcode.com/topic/ema...
MCG
4 weeks ago
0
Indicators
Iván
1 month ago
6
Indicators
Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Hi, Lines 62 and 63. These lines define buy and sell conditions.
philippe59139
1 month ago
0
Indicators
Iván
2 months ago
4
Indicators
Hi You should delete from the indicator code all drawing functions and all variables not us...
I've created a screener to show [longcondition or shortcondition]
Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
Iván
2 months ago
6
Indicators
Thanks, now it's OK. in your first code at line 15-16 it's missing.
Hello Ivan Did you try a strategy with this indicator
Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
2 months ago
6
Indicators
Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
Gracias!!
i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
2 months ago
3
Indicators
Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
jacquesgermain
2 months ago
7
Indicators
sì da aggiungere
auf welchen Wert muss ich die Kompresionsperiode stellen?
— Période de compression : ce paramètre détermine la période de rétrospection utilisée pour ...
Iván
3 months ago
0
Indicators
Iván
3 months ago
3
Indicators
Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Hi, Yes I can translate it but please, create a new topic for it.
Fgats
3 months ago
3
Indicators
quelques explications en Français ici : Some explanations in French here : https://www.p...
Merci pour cette contribution, j'apprécie ! :)
Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
davidelaferla
4 months ago
1
Indicators
A question: what are the initial (or default) values ​​of maximum and minimum in the executi...
Quino
5 months ago
0
Indicators
LucasBest
8 months ago
1
Indicators
Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas
9 months ago
8
Indicators
Bonjour Nicolas, Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un...
Le lien vers l'article IFTA de l'auteur est dans le post déjà :)
Very poweful indeed. It deserves close attention. I really appreciate very much IFTA backgro...
JS
9 months ago
0
Indicators

Top