Yu Zhang:
Just like the Pic:
int right_shift = ChartGetInteger(0,CHART_WIDTH_IN_BARS) - ChartGetInteger(0,CHART_VISIBLE_BARS) + 1; datetime right_time = time[0] + right_shift*PeriodSeconds();
- You squared the triangle. That points to the first candle on the chart. There is no future.
- As Ezatrimeo stated, you can use shift*PS, but that assumes that all bars will exist in the future — they don't. What if there are no ticks during a specific candle period? There can be minutes between ticks during the Asian session, think M1 chart. Larger charts, think weekend, market holiday (country and broker specific), requires knowledge of when your broker stops and starts (not necessary the same as the market.)
"Free-of-Holes" Charts - MQL4 Articles (2006)
No candle if open = close ? - MQL4 programming forum (2010)
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
Just like the Pic: