wrong parameters count

 

any one tell why i got 'OrderSend' - wrong parameters count built-in: bool OrderSend(const MqlTradeRequest&,MqlTradeResult&)

any one clarify ??


// Open a sell order

        ticket = OrderSend(_Symbol, ORDER_TYPE_SELL, lotSize, SymbolInfoDouble(_Symbol, SYMBOL_ASK), 3, 0, 0, "Sell Order", magicNumber, 0, Blue);
 
This is MT5
 bool OrderSend(const MqlTradeRequest&,MqlTradeResult&)
This is MT4
 ticket = OrderSend(_Symbol, ORDER_TYPE_SELL, lotSize, SymbolInfoDouble(_Symbol, SYMBOL_ASK), 3, 0, 0, "Sell Order", magicNumber, 0, Blue); 
You posted in the MT5 general section. Decide which language you are using and code in that language.
 
William Roeder #:
This is MT5
This is MT4
You posted in the MT5 general section. Decide which language you are using and code in that language.

could you please give code for this line only for MT5 version below : 


        ticket = OrderSend(_Symbol, ORDER_TYPE_SELL, lotSize, SymbolInfoDouble(_Symbol, SYMBOL_ASK), 3, 0, 0, "Sell Order", magicNumber, 0, Blue);

 
Al Amri #:

could you please give code for this line only for MT5 version below : 


        ticket = OrderSend(_Symbol, ORDER_TYPE_SELL, lotSize, SymbolInfoDouble(_Symbol, SYMBOL_ASK), 3, 0, 0, "Sell Order", magicNumber, 0, Blue);

Search: https://www.mql5.com/en/search#!keyword=OrderSend&module=mql5_module_documentation

 
Al Amri #: could you please give code for this line only for MT5 version below :
 ticket = OrderSend(_Symbol, ORDER_TYPE_SELL, lotSize, SymbolInfoDouble(_Symbol, SYMBOL_ASK), 3, 0, 0, "Sell Order", magicNumber, 0, Blue); 

You don't replace just one line, it must be rewritten. MT4 only has orders (pending and open). MT5 has orders, deals, and positions.

 
William Roeder #:

You don't replace just one line, it must be rewritten. MT4 only has orders (pending and open). MT5 has orders, deals, and positions.

Everything good only this line and i lunch it on MT5 but i have problem with line 
 
Al Amri #: Everything good only this line and i lunch it on MT5 but i have problem with line 

No, not all good. That one line shows that a large part of your code is not compatible with MQL5.

You probably generated it using ChatGPT (or other A.I.) which produces horrible code, mixing MQL4 and MQL5.

So, please don't request help for generated code. Learn to properly code in MQL5 or hire a programmer in the Freelance section.

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2024.01.20
  • www.mql5.com
The largest freelance service with MQL5 application developers
Reason: