I just started coding for MT5. I am able to open a position, close it through take profit and stop loss, but I can't seem to get the code to close the open position if, say, it is after 5.00pm.
Are there any suggestions I may be aware of? Or could you simply let me know how an open position can be closed after a certain time?
Many thanks in advance,
You can use this way.Happy coding :)
if (time.day_of_week==5 && time.hour>=17 && time.min>=15) trade.PositionClose(...);