How do I get the time that is most on the right of the chart?

 

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 that time right there?


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!

 
Use these functions:
ChartGetInteger(0,CHART_VISIBLE_BARS,0)
ChartGetInteger(0,CHART_WIDTH_IN_BARS,0)
 
  1. 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

  2. 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.

  3. You shouldn't care. Why do you?
 
whroeder1:
  1. 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

  2. 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.

  3. You shouldn't care. Why do you?
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 :)
Use these functions:

Thank you, works fine :)