I tried the ZigZag indicator on a volume-based chart using the data from replay connection. I need the following improvement.
1) Update ZigZag Low High point on the current bar which is still in formation. I noticed it only update it on the completed bar if any update is possible. Although in the setup it is calculate on every tick, it didn't work on the latest bar. (For a SMA indicator, I can observe its working on the latest tick if I set it up to calculate on every tick.)
2) After ZigZag high is formed, If there is any new bar with its high higher than the zig zag high, update it immediately. It only add a new zigzag low point after at least N bars without new update on zigzag high, and the low of a forming bar is M+ points to the last zigzag high.
3) After ZigZag low is formed, if there is any new bar with its low lower than the zig zag low update it immediately. It only add a new zigzag high point after at least N bars without new update on zigzag low, and the high of a forming bar is M+ points to the last zigzag low.
2) and 3) is actually the same logic.
I went through the code of ZigZag.But I have no idea how to make the modifications.
Attached a sample picture. By doing the above 1, 2, 3), it can remove the spikes in the picture.
Please guide me how to modified the zigzag indicator. Many thanks! I am using NT8.
Best Regards
David WANG
Comment