- Katılım
- 23 Eki 2020
- Mesajlar
- 1,828
This was my first attempt to confront the problem of the dynamic last leg of the zigzag indicator. Articles of mine about this indicator and the problem of the last leg of the zigzag indicator have been published by the Technical Analysis of Stocks and Commodities (August 2002 issue) and by the Guppy Traders (September 2002 issue). It returns 1 for valid LAST leg of zig() - regardless of zig's direction - and 0 for revisable (NOT valid) LAST leg. It is NOT a stand-alone indicator, but it has to be used WITH the zigzag indicator. It is useful for visual inspection only. ZigZag Validity's PAST readings are NOT trustworthy. It must NOT be used in systems. It does NOT say the truth about the past, but it is absolutely RELIABLE about the PRESENT! (Strange but true!) This indicator returns 1 for valid LAST leg of zig() - regardless of zig's direction - and 0 for revisable (NOT valid) LAST leg. It is NOT a stand-alone indicator, but it has to be used WITH the zigzag indicator. The zig() should calculate close prices and should use the same percent with the ZigZag validity. You must realize that while zig() is always correct about the past but not reliable about the present, Zigzag Validity is trusty NOW (validating the last leg of zig) but NOT in the past. This makes both zig() and Zigzag Validity NOT suitable for back tests. Use both indicators for visual inspection only! |
|
ZigZag Validity {*********** Start of code *************} {ZigZag validity by Spyros Raftopoulos It validates the LAST LEG of the Zigzag indicator. 1=valid (not revisable), 0=invalid (revisable). Do NOT use this indicator in systems.} perc:=Input("Percent",0.2,100,10); Z:=Zig(CLOSE,perc,%); last:=ValueWhen(1,( Z > Ref(Z,-1) AND Ref(Z,-1) < Ref(Z,-2) ) OR ( Z < Ref(Z,-1) AND Ref(Z,-1) > Ref(Z,-2) ), Ref(Z,-1)); pc:=(CLOSE-last) * 100 / last; pc:= Abs(pc); SD:=(z>Ref(z,-1) AND Ref(z,-1)>Ref(z,-2)) OR (z<Ref(z,-1) AND Ref(z,- 1)<Ref(z,-2)); res:=If(pc>=perc ,1,0); If(Alert(res,2) AND SD,1,res) {*********** End of code *************} |
Contact me for comments or questions at raftsp@otenet.gr | |
| |
Source / From: |