
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
CiDuanBuffer stores an indicator which could be think as Zigzag (almost the same). What I want to do here is to show "Zigzag from a lower timeframe" on the chart(which is a higher timeframe).
An example would be to show a 1min Zigzag on 15min chart. So I first get the current minute(assume the market is openning), then decide a gap_k. For example, if the current min is 47,then the
current 15min K(**:45:00) will have a gap_K of 2. So if there is a zigzag value (not equal to 0) in position 1 or 2, the value will be displayed on the current 15min K. From then on, each zigzag value will be corresponding to position index MathFloor((i-GapK)/15)+1. For example position 6 will be on position 1 (on the current 15min chart), position 22 will be on position 2, etc
It works well in the most recent bars. Perhaps first 2000 bars. And then it starts to shift right, some of the positions are wrongly showed 1 bars, 2bars behind. Then it gets worse, 5 bars, 6 bars, and then totally mess. Anyone tell me what happened? I can't figure out why.
Thanks for any help!