No error to read from future time buffer?

 
I am trying to find a way to detect non-exists trading time, when market is closed or over weekend. I do a simple test:

void DisplayATR()
  {
   datetime tm=TimeCurrent();
   tm = tm + 3000000000;
   
   
   if(CopyBuffer(ATRHandle,0,tm,1,ATRBuffer)<=0)
     {
      Print("Getting ATR failed! Error",GetLastError());
      return;
     }
   double ATR=(ATRBuffer[0] *InpMultiplier)*MathPow(10,_Digits-InpDisplay);
   string Text=(string)(InpMultiplier*100)+"% of ATR ("+(string)InpATRPeriod+") : "+DoubleToString(ATR,0)+" "+EnumToString(InpDisplay);
   DrawLabel("ATR",Text);
  }
To read into future buffer, I still get buffer filled. Is there a way to detect non-existence of data during past non trading hours?
 
  1. You can not read into the future.
  2. You assume every bar every exists — 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 (20 June 2006)
              No candle if open = close ? - MQL4 programming forum
 
William Roeder #:
  1. You can not read into the future.
  2. You assume every bar every exists — 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 (20 June 2006)
              No candle if open = close ? - MQL4 programming forum

ok, thank,


is there a way to get the below info?

 
Sunfire #: is there a way to get the below info?

Yes. Perhaps you should read the manual.
   How To Ask Questions The Smart Way. (2004)
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

 
any class, structure or whatever in mql language I can get session info of a symbol?
 
William Roeder #: Yes. Perhaps you should read the manual.