sellrequest.order is for Order Ticket. sellrequest.type is what you need to assign ORDER_TYPE_SELL to.
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
Oh! Thank you, that worked.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a problem:
When I run this "SELL" trade request in the strategy tester, the journal reports it as a BUY order, and because of that the stop loss and take profits are swapped, resulting an [Invalid Stops] error.