I just wrote and didn't test it. Should give you some idea.
if (Hour() == 23) { for (int i=(OrdersTotal()-1); i>=0; i--) { if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true) { OrderClose(OrderTicket(),OrderLots(), NormalizeDouble(Bid,Digits),4,Blue); } } }
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,, please i wanna add this line to my expert
if time=23,then close all opening positions