What is wrong with my ORDER_TYPE_SELL_LIMIT

 

The values are:

lot = 0.15

retracePrc =1.23196

slPrc = 1.23409

tpPrc = 1.2277

Also current bid/ask  = 1.22720 / 1.22726

This is the code where I try to open a position:

myTradingControlPanel.PositionOpen( _Symbol, ORDER_TYPE_SELL_LIMIT, lot, retracePrc, slPrc, tpPrc, "Sell Trade. Magic Number #"+(string) myTradingControlPanel.RequestMagic());

No order tickets are found after executing line above and the error code returned is 4753. Any ideas?

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Order Properties - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
  1. Learn to place SL and TP correctly, not within the minimum distance and on the correct side: SL<buy<TP and SL>sell>TP
  2. Learn to check the error code and
  3. Learn to use the debugger:
    Code debugging:  https://www.metatrader5.com/en/metaeditor/help/development/debug
    Error Handling and Logging in MQL5:  https://www.mql5.com/en/articles/2041
    Tracing, Debugging and Structural Analysis of Source Code, scroll down to: "Launching and Debuggin": https://www.mql5.com/en/articles/272

Code debugging - Developing programs - MetaEditor Help
  • www.metatrader5.com
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code...