Search code examples
algorithmic-tradingmql4metatrader4mt4

OrderSend color ignored


Does somebody know why the color arrow isnt get painted in the next order call?

OrderSend(symbolName, lotsNumber, bid, slip, 0, takeProfit, coment, Red);

Thanks!


Solution

  • Check MQL4 Syntax:

    iORS = OrderSend( Symbol(),     // .SYM          
                      OP_SELL,      // .OP <------------------------- MISSING
                      dLots,        // .LT
                      Bid,          // .ENTRY
                      5,            // .SLIPPAGE
                      0,            // .SL
                      0,            // .TP
                      sSHORT,       // .COMMENT
                      2000,         // .MAGNUM <--------------------- Red
                      0,            // .EXPIRE
                      Red           // .CLR
                      );
    

    Test ( always ) Return Value:

    if ( iORS == EMPTY ) {... /* HANDLE FAILED OrderSend() */ }