MT5 basics (8)
order types
send pending orders
what is the function of this code?
order types
send pending orders
what is the function of this code?
Inserted Code
void OnInit()
{
MqlTick last_tick={};
SymbolInfoTick(_Symbol,last_tick);
MqlTradeRequest request={};
request.action=TRADE_ACTION_PENDING;
request.magic=0;
request.symbol=_Symbol;
request.volume=1;
request.sl=0;
request.tp=0;
request.type=ORDER_TYPE_BUY_LIMIT;
//--- form the price for the pending order
for(int i=0;i<100;i++)
{
request.comment="##"+i;
request.price=last_tick.bid-(i+1)*100*_Point;
Print(request.price);
MqlTradeResult result={};
bool aa=OrderSend(request,result);
Print(__FUNCTION__,":",result.comment);
if(result.retcode==10016) Print(result.bid,result.ask,result.price);
}
} each day 10%,,,, https://www.forexfactory.com/thread/1371538
1