STEP10 – How to build a real sell order

Our sell order is almost identical to the buy order in Step9

The difference is, that we use the BID price this time

 

void OpenSellOrder()
{
MqlTradeRequest myrequest;
MqlTradeResult myresult;
ZeroMemory(myrequest);
myrequest.action = TRADE_ACTION_DEAL;
myrequest.type = ORDER_TYPE_SELL;
myrequest.symbol = _Symbol;
myrequest.volume = LotSize; // use a double value
myrequest.type_filling = ORDER_FILLING_FOK;
myrequest.price = SymbolInfoDouble(_Symbol,SYMBOL_BID);
myrequest.sl = 0 ;
myrequest.tp = 0 ;
myrequest.deviation =60;
OrderSend (myrequest,myresult);
LastEquity=AccountInfoDouble(ACCOUNT_EQUITY);
}