Hi all,
Here is an home made indicator.
I took the indicator code stochastic and I integrated the ZigZag.
I thank Jose7674 very much for his code, concerning the divergences of the MACD, which I used for my indicator.
See: MACD Divergences on price and indicator
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
//Zero Lag ZigZag Stochastic //Le 23 octobre 2018 //Matriciel @ www.prorealcode.com //Sharing ProRealTime knowledge //Settings Q = 5 R = 5 Lookback = 120 Periode = 20 PeriodeZZ = 0.02 //Zero Lag ZigZag Stochastic ZZH = ZigZag[PeriodeZZ](HIGH) ZZL = ZigZag[PeriodeZZ](LOW) plusHaut = HIGHEST[Periode](ZZH) plusBas = LOWEST[Periode](ZZL) A = (CLOSE - plusBas) / (plusHaut - plusBas) * 100 B = AVERAGE[Q](A) ligneK = AVERAGE[Q](B) Difference = (A - ligneK) C = (B + Difference) ZeroLagSto = AVERAGE[5](C) ligneD = AVERAGE[R](ZeroLagSto) ///divergence baissière IF (ZeroLagSto[1]>ZeroLagSto AND ZeroLagSto[1]>ZeroLagSto[2]) THEN extremum2=ZeroLagSto[1] extremum1=highest[Lookback](ZeroLagSto) preciomax2=close[1] preciomax=Highest[Lookback](close) IF(extremum2<extremum1 AND preciomax2>preciomax[1]) THEN for i=1 to Lookback if ZeroLagSto[i]=extremum1 then zz=i drawsegment (barindex[1], ZeroLagSto[1], barindex[zz], ZeroLagSto[zz]) coloured(200,0,0) ENDIF next ENDIF ENDIF ///divergence haussière IF (ZeroLagSto[1]<ZeroLagSto AND ZeroLagSto[1]<ZeroLagSto[2]) THEN extremum22=ZeroLagSto[1] extremum11=lowest[Lookback](ZeroLagSto) preciomin2=close[1] preciomin=lowest[Lookback](close) IF(extremum22>extremum11 AND preciomin2<preciomin[1]) THEN for i2=1 to Lookback if ZeroLagSto[i2]=extremum11[1] then zz2=i2 drawsegment(barindex[1], ZeroLagSto[1], barindex[zz2], ZeroLagSto[zz2]) coloured(0,200,0) ENDIF next ENDIF ENDIF RETURN ZeroLagSto coloured(0,0,200) style(line,1) AS "ZeroLagSto", ligneD coloured(0,0,200) style(dottedline,1) AS "ligneD", 50 style(dottedline,1) AS "Middle" |
Share this
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 :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Is it an indicator you integrate in your trading / scalping ? Could you have some words about it ? A kind of feedback of yhe way you are using it.
I use this indicator to help me make a decision when there is a divergence. The divergences are very significant with this indicator.
Scalping is better when you trade divergences !
I use this indicator to help me make a decision when there is a divergence. The divergences are very significant with this indicator.
Scalping is better when you trade divergences !
Ich habe es mit N= 1,5 und N=2,5 getestet mit 200000 Einheiten. Es funktioniert leider erst ab 2016.
Hi,
I personnaly am not a big fan of ZIGZAG indicator, as it repaints itself during time. (as the actuality becomes history, you exactly know what you should be trading)
Given this in my opinion noisy aspect of the ZIGZAG indicator, how do you deal with that in your indicator ?
KR Jan