Expression has no effect compilation error

 

Hi,

When I compile my code below, I get the error: 'type' - some operator expected and also 'ORDER_TYPE_SELL' - expression has no effect. It only happens for my 'else' bit which is trying to execute a market order. My limit order works fine and does what I want.

(note: I define stuff like sl, tp, deviation, symbol earlier in the code)

 Thanks for the help! 

 

         if(SymbolInfoDouble(Symbol(),SYMBOL_BID)<close[2])
           {
            request.action= TRADE_ACTION_PENDING;
            request.price = close[2];
            request.type=ORDER_TYPE_SELL_LIMIT;
            request.type_time=ORDER_TIME_SPECIFIED;
            request.expiration=TimeCurrent(dt)+leaveopen*PeriodSeconds();
            OrderSend(request,result);
            lasttradetime=TimeCurrent(dt);
           }
         else
         {
            request.action = TRADE_ACTION_DEAL;
            request.price = SymbolInfoDouble(Symbol(),SYMBOL_BID)
            request.type=ORDER_TYPE_SELL;
            OrderSend(request,result);
            lasttradetime = TimeCurrent(dt);
         }

 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
 
Spy_Lord:

Hi,

When I compile my code below, I get the error: 'type' - some operator expected and also 'ORDER_TYPE_SELL' - expression has no effect. It only happens for my 'else' bit which is trying to execute a market order. My limit order works fine and does what I want.

(note: I define stuff like sl, tp, deviation, symbol earlier in the code)

 Thanks for the help! 

 

 

request.price = SymbolInfoDouble(Symbol(),SYMBOL_BID);
 
Wahoo:
That simple! Thanks very much ;)