There's no new bar when market close, sunday is where market close (except crypto).
Alberto Tortella:
Hi all, could you suggest a method to detect if previous bar is Sunday?
Thank you!
Here you go, just for you.
void OnTick() { if(prev_day_week() == 0) Print("Previous Candle Day is Sunday"); else Print("Previous Candle Day is definitely not a Sunday"); } //+------------------------------------------------------------------+ int prev_day_week() { MqlDateTime tm; datetime prev_day = iTime(_Symbol, PERIOD_CURRENT, 1); TimeToStruct(prev_day, tm); return(tm.day_of_week); }
Thank you very much!

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 all, could you suggest a method to detect if previous bar is Sunday?
Thank you!