Use these functions:
ChartGetInteger(0,CHART_VISIBLE_BARS,0) ChartGetInteger(0,CHART_WIDTH_IN_BARS,0)
-
It's not pointing to any time. You can't just add time periods because no ticks during a period, no bar; think weekend, market holiday, or no ticks for minutes Asian session/M1 chart. "Free-of-Holes" Charts - MQL4 Articles No candle if open = close ? - MQL4 and MetaTrader 4 - MQL4 programming forum -
You can calculate how many bars, as Taras Slobodyanik hinted at, or use my code (old MT4 style) Chart Price Max/Min - MQL4 and MetaTrader 4 - MQL4 programming forum But in either case you can only estimate the time, and any (non-label objects) you draw, must be moved/adjusted at each new bar or chart change.
- You shouldn't care. Why do you?
whroeder1:
I wanted to place a fibonacci object to the right of price and misuse it as a display of significant levels. Taras solution worked for that case :)-
It's not pointing to any time. You can't just add time periods because no ticks during a period, no bar; think weekend, market holiday, or no ticks for minutes Asian session/M1 chart. "Free-of-Holes" Charts - MQL4 Articles No candle if open = close ? - MQL4 and MetaTrader 4 - MQL4 programming forum -
You can calculate how many bars, as Taras Slobodyanik hinted at, or use my code (old MT4 style) Chart Price Max/Min - MQL4 and MetaTrader 4 - MQL4 programming forum But in either case you can only estimate the time, and any (non-label objects) you draw, must be moved/adjusted at each new bar or chart change.
- You shouldn't care. Why do you?
Use these functions:
Thank you, works fine :)

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
Hi,
How can I find out (programmaticaly) what the time is on the rightmost (not yet initialized) bar on the chart?
For clarification:
What is the time where the arrow is pointing? It's in the future obviously, but how much? I can't just add some time amount to the current bar time because this empty space can be controlled individually via the chart displacement arrow on the top of the window... Ideas? :/
Thanks in advance!