python mt5 open order "invalid request" error

 

hello everyone

i'm facing "invalid request" error while opening *SELL* order using mt5 python api:

for example current price is 1880.00

here request is my code:

                request = {
                    "action": mt5.TRADE_ACTION_PENDING,
                    "symbol": symbol,
                    "volume": 0.1,
                    "type": mt5.BOOK_TYPE_SELL,
                    "price": 1890.00 ,
                    "sl": 1900.00 ,
                    "deviation": 20,
                    "magic": 234000,
                    "comment": "python script open",
                    "type_time": mt5.ORDER_TIME_GTC,
                    "type_filling": mt5.ORDER_FILLING_RETURN,
                }


Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes
Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes
  • www.mql5.com
Trade Server Return Codes - Codes of Errors and Warnings - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Please insert the code correctly: when editing a message, press the button      Codeand paste your code into the pop-up window.