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); |
This is MT5 | |
This is MT4 |
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);
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
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.
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.

- 2024.01.20
- www.mql5.com
In MQL5, the OrderSend function should be replaced with trade.Buy , trade.Sell , or another appropriate trading method from the CTrade class.
Al Amri:
any one tell why i got 'OrderSend' - wrong parameters count built-in: bool OrderSend(const MqlTradeRequest&,MqlTradeResult&)
any one clarify ??
// Open a sell order
The OrderSend function in MQL5 has different parameters compared to MQL4. The error you're seeing is because the OrderSend function in MQL5 does not have the same parameter order or number of parameters as in MQL4.
In MQL5, the OrderSend function should be replaced with trade.Buy , trade.Sell , or another appropriate trading method from the CTrade class.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
any one tell why i got 'OrderSend' - wrong parameters count built-in: bool OrderSend(const MqlTradeRequest&,MqlTradeResult&)
any one clarify ??
// Open a sell order