Excuse me, how do we trade in the time stipulated every day?
- Why did you post your MT4 question in the
Root /
MT5 EA section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. if( 02:00<OrderOpenTime if (OrderCloseTime<23:30 ) OrderClose(OrderTicket(),OrderLots(),Bid,0,Red)
You can not use any Trade Functions until you first select an order.if (OrderCloseTime<23:30 )
If the order is open, it has no close time.- Stop thinking trade functions, think current time.
- If the current time is at or after 02:00 but before 23:00 and there is no open order, open one.
- If the current time is not at or after 02:00 but before 23:00, close any existing one.
#define HR0200 7200 #define HR2300 82800
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 and MetaTrader 4 - MQL4 programming forum
whroeder1:
Thank you very much! I don't know the rules. I simply think that the code is generic, in MT4 or MT5 didn't expect that there are difference.
I want to make the daily transaction time: 02:00-23:30, close all orders before 23:30 every day. How should I write?