Help me with error please. -cannot convert enum - page 2

 
B335C0B4 #:

Can anyone please tell me why my Robot does not work on deriv??

Ask the author/seller.

 
B335C0B4 #:
Can anyone please tell me why my Robot does not work on deriv??

That's strange, mine seems to be working fine 
 
MqlTick tick = {};
double entry = 0;

bool TradeRequestMarket(string ins,double volume,ulong deviation,double sl,double tp,ulong magic,string comment=NULL,ENUM_ORDER_TYPE_FILLING type_filling=ORDER_FILLING_FOK)
  {
   if(SymbolInfoTick(Symbol(),tick))
     {
      MqlTradeRequest request = {};
      MqlTradeResult result = {};

      request.symbol = ins;
      request.volume = volume;
      request.action = TRADE_ACTION_DEAL;
      request.price = entry;
      request.type = type;
      request.deviation = deviation;
      request.comment = comment;

      request.magic = magic;
      request.price =  entry;
      request.type_filling = type_filling;
      request.sl = sl;
      request.tp = tp;



      if(OrderSend(request,result))
        {
         Print("Order ", EnumToString(type)," Placed = ",result.order);
         return true;
        }
      else
        {
         Print("Order Failed = ",GetLastError());
         return false;
        }
     }
   return true;
  }

void OnTick()
  {
   double tick_size = SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_SIZE);
   double tp = 0;
   double sl = 0;

   if(type == ORDER_TYPE_BUY)
     {
      entry = tick.ask;
      tp = entry + tp_ticks * tick_size;
      sl = entry - sl_ticks * tick_size;
     }

   if(type == ORDER_TYPE_SELL)
     {
      entry = tick.bid;
      sl = entry + sl_ticks * tick_size;
      tp = entry - tp_ticks * tick_size;
     }

   TradeRequestMarket(Symbol(),type,0.1,10,sl_ticks,tp_ticks,1234,"Long Position",ORDER_FILLING_FOK);
   TradeRequestMarket(Symbol(),type,0.1,10,sl_ticks,tp_ticks,12345,"Short Position",ORDER_FILLING_FOK);
   ExpertRemove();
  }
I have problem error is given 👇

'Long Position' - cannot convert enum

'Short Position' - cannot convert enum

Please Solve this Source code....






 
TradeRequestMarket expects a double as second parameter but you call it with an enum, 3rd parameter should be long but you call it with double and so on.
 
Sascha Thomas #:
TradeRequestMarket expects a double as second parameter but you call it with an enum, 3rd parameter should be long but you call it with double and so on.
🙏Thank you, It is working Sir.
Reason: