Nicolas

OnChart Stochastic

Category: Indicators By: Nicolas Created: May 23, 2018, 1:54 PM
May 23, 2018, 1:54 PM
Indicators
10 Comments
OnChart Stochastic

The “onChart Stochastic” indicator plots a stochastic oscillator directly overlaid on the price chart.
The price range of the stochastic is calculated with the daily Average True Range of the last 20 periods (days).
This price range is then applied centered over a moving average on price. Consequently, the overbought and oversold levels are the upper and lower bands of the channel. By using this kind of approach, any bounded oscillator could be applied on the price chart, like the way this indicator does (RSI, CCI, etc.).
Converted from a MT4 indicator by a request in the English forum.

//PRC_OnChart Stochastic | indicator
//23.05.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

// --- settings
KPeriod = 26
Slowing = 5
DPeriod = 5
ATRperiod = 20
maPeriod = 20
maMethod = 0
overBought = 80
overSold = 20
// --- end of settings

maPrice = customclose

dTR = 0
for i = 0 to ATRperiod-1
 dTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))
next

avgRange = dTR/ATRperiod
maValue = average[maPeriod,maMethod](maPrice)
stochValue = Stochastic[Kperiod,Slowing](maPrice)
signalValue = average[Dperiod,maMethod](stochValue)
//----
Buffer1=maValue
Buffer2=maValue+(avgRange*(overBought-50)/100)
Buffer3=maValue-(avgRange*(50-  overSold)/100)
Buffer4=maValue+(stochValue -50)/100*avgRange
Buffer5=maValue+(signalValue-50)/100*avgRange

return Buffer1 coloured(102,0,0) style(dottedline,1) as "mid level", Buffer2 coloured(102,0,0) style(dottedline,1) as "overbought level", Buffer3 coloured(102,0,0) style(dottedline,1) as "oversold level", Buffer4 coloured(0,255,0) style(line,2) as "OnChart stochastic", Buffer5 coloured(255,0,0) style(line,2) as "Signal line"

 

Download
Filename: PRC_OnChart-Stochastic-1.itf
Downloads: 433
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Radetzky
7 years ago
#

Buongiono e grazie : l'immagine sopra ritrae l'indicatore sul TF 15 min ma a me funziona solo DAY e H1 per il 15 min / 5 min devo apportare qualche modifica ??? grazie

Stenozar
8 years ago
#

thanks Nicolas, I' ll try again!

Stenozar
8 years ago
#

Hi I can't visualize the indicator on the chart? can anybody help me, please?

Nicolas
8 years ago
#

Add it on price using the wrench on the left upper side of the price chart.

odin
8 years ago
#

great work!

Domenec
8 years ago
#

Ya esta lo he conseguido estas son las imagenes https://www.screencast.com/t/upBvffuN ademas ahora se pueden cambiar tanto los parametros de los dos osciladores como la media mobil si se pone en 100 o en 200 ademas la linea discontinua de puntos azul es el eje de los estocasticos y al mismo tiempo esta media movil muy bueno el indicador Nicolas

Domenec
8 years ago
#

Ya se que soy un desastre pero prometo que un dia aprendere jajajajaaj https://www.screencast.com/t/IeQ1Bpca

Domenec
8 years ago
#

He colgado un nuevo codigo a partir de tu codigo pero veo que no aparece lo he hecho con el añadir codigo PRT pero no sale

Domenec
8 years ago
#

Hola Nicolas A ver cogiendo tus conocimientos he realizado un nuevo codigo no con uno sino con dos osciladores asi me permite programar mi Sistema de trenes (que explico en el codigo) sin embargo como casi siempre hasta que aprenda mas algo no hago bien y no dibuja las flechas de entrada y salida Este Sistema llamado de "Trenes" da trades de altisima probabilidad y con mas del 85 % de aciertos

luxrun
8 years ago
#

Dear Nicolas, what are the recommended settings for the daily chart?

ProRealCode ProRealCode
Loading...