It's not constant, what makes you think it is ?
This line is useless as is :
StringFormat("FridayOrWeekend %s dow=%d",TimeToString(history_data[0].time),xbar.day_of_week);
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hello,
i want to check day of week using TimeToStruct within OnTick, when new bar occurs.
The problem: Day of week is constant.
TimeToStruct on latest completed bar fetched with CopyRates, returns no error an also the bar date
is changing.
This problem occurs only with GBPUSD and not with US30 for instance. Historical data are bad but when the history_data[0] is correct, which is the case
and TimeToStruct is not failing, why is the xbar.day_of_week constant ?
Thank you for help