Matriciel

Zero Lag ZigZag Stochastic

Category: Indicators By: Matriciel Created: October 25, 2018, 4:59 PM
October 25, 2018, 4:59 PM
Indicators
4 Comments
Zero Lag ZigZag Stochastic

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

//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"

 

Download
Filename: ZeroLag-ZigZag-Stochastic.itf
Downloads: 228
Matriciel
Matriciel Master
Operating in the shadows, I hack problems one by one. My bio is currently encrypted by a complex algorithm. Decryption underway...
Author’s Profile

Comments

Jan Wind
8 years ago
#

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

teddy58
8 years ago
#

Ich habe es mit N= 1,5 und N=2,5 getestet mit 200000 Einheiten. Es funktioniert leider erst ab 2016.

Sofitech
8 years ago
#

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.

Matriciel
8 years ago
#

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 !

ProRealCode ProRealCode
Loading...