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
To check if market is close (brokers trading hours / trading holiday etc.) I suggest this code:
if (SymbolInfoInteger(Symbol(), SYMBOL_TRADE_MODE) != SYMBOL_TRADE_MODE_FULL)
return;
Place this first in the OnTick() function.
I had this similar problem, and it boiled down to the IsNewBar() function when running on the daily, weekly and monthly, all new bars starting at 00:00, hence none of my trades will get processed because this fell outside my brokers trading sessions.
Solution was to check IsNewBar() for the daily, weekly and monthly on the 12hr timeframe, hence the IsNewBar() function will look like this:
So in other words the daily check will occur at 12:00 instead of 00:00...