I'm beginner in MQL5. I am trying to create OrderSend expert.
I write this code :
int OnInit()
{
MqlTradeRequest request ;
MqlTradeResult result ;
request.action = TRADE_ACTION_PENDING;
request.type = ORDER_TYPE_BUY_LIMIT;
request.symbol = _Symbol;
request.volume = 100 ;
request.price = 45400 ;
request.sl = request.price - (request.price*0.1);
request.tp = request.price + (request.price*0.2);
request.expiration = D'2021.10.10 13:00:00';
request.type_filling = ORDER_FILLING_RETURN ;
OrderSend(request,result);
return(INIT_SUCCEEDED);
}
But when run I am getting this expert error :
" 2021.10.01 00:00:00 failed buy limit 100 [my symbol] at 45400 sl: 40860 tp: 54480 [Invalid expiration]"
In Strategy Tester window I enter custom period from 2021.10.01 to 2021.10.20. I also tried my hard and select different date but not worked anything.
Any advise will be appreciated!