Please help with OrderSend Error

 
I'm getting this error. A
'OrderSend' - wrong parameters count
built-in: bool OrderSend(const MqITradeRequest&, MqITradeResuIt&)
deprecated behavior, hidden method calling will be disabled in a future MOL compiler version
'OrderSend' - wrong parameters count

built-in: bool OrderSend(const


void ExecuteTrade(int type, double lots) {
   double price = SymbolInfoDouble(_Symbol, SYMBOL_ASK); // current ask price
   double sl = price - 50 * _Point; // 50 pips below the current price
   double tp = price + 100 * _Point; // 100 pips above the current price
   datetime expiration = 0;
   int magic = 123456;
   if (type == OP_BUY)  
      OrderSend(Symbol(), OP_BUY, lots, price, 3, sl, tp, "My Order", magic, 0, Blue);  
   else if (type == OP_SELL)       
      OrderSend(Symbol(), OP_SELL, lots, price, 3, sl, tp, "My Order", magic, 0, Red);

    }
 

You are using MQL4 code and expecting it to work on MQL5?

The OrderSend format you are using is from MQL4. Please read the MQL5 documentation — Documentation on MQL5: Trade Functions / OrderSend

Your topic has been moved to the section: Expert Advisors and Automated Trading — In the future, please consider which section is most appropriate for your query.

Documentation on MQL5: Trade Functions / OrderSend
Documentation on MQL5: Trade Functions / OrderSend
  • www.mql5.com
OrderSend - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Fernando Carreiro #:

You are using MQL4 code and expecting it to work on MQL5?

The OrderSend format you are using is from MQL4. Please read the MQL5 documentation — Documentation on MQL5: Trade Functions / OrderSend

Your topic has been moved to the section: Expert Advisors and Automated Trading — In the future, please consider which section is most appropriate for your query.

Thank you, do you know the Mql5 equivalent?

 
Mezzoforte Privilège #:Thank you, do you know the Mql5 equivalent?
I gave you the link. Why did you not read it?