Hi, I obtained this error on my script...Why?
did you try looking the result code up?
https://www.mql5.com/en/docs/constants/errorswarnings/enum_trade_return_codes
with this problem and your copy ticks problem - I would suggest that you are not connected to the servers correctly
- www.mql5.com
10016 | TRADE_RETCODE_INVALID_STOPS | Invalid stops in the request |
and in the result of the script appear 'No prices'. I try to make some changes (stop loss, take profit...), but without success ... The code is correct, because it is in this official page
https://www.mql5.com/en/docs/integration/python_metatrader5/mt5ordersend_py
I don't know how to do...
- www.mql5.com
Yes, i'm looking for
10016 | TRADE_RETCODE_INVALID_STOPS | Invalid stops in the request |
and in the result of the script appear 'No prices'. I try to make some changes (stop loss, take profit...), but without success ... The code is correct, because it is in this official page
https://www.mql5.com/en/docs/integration/python_metatrader5/mt5ordersend_py
I don't know how to do...
10021 | There are no quotes to process the request |
but I don't understand the error, because there are the price, stop loss and take profit...The account is a new demo ( There are quotes to process the request ), and so I don't know where the error might be.
Can you open it directly from MT5 ?
Which broker/server are you using ?
... "type_filling": mt5.ORDER_FILLING_RETURN,
Are you sure you can use that filling type ? It's not allowed with MARKET execution.
- www.mql5.com
>>> point 1e-05 >>> price 1.13437 >>> deviation = 20 >>> request = { ... "action": mt5.TRADE_ACTION_DEAL, ... "symbol": symbol, ... "volume": lot, ... "type": mt5.ORDER_TYPE_BUY, ... "price": price, ... "sl": price - 50000 * point, ... "tp": price + 50000 * point, ... "deviation": deviation, ... "magic": 234000, ... "comment": "python script open", ... "type_time": mt5.ORDER_TIME_GTC, ... } >>> request {'action': 1, 'symbol': 'EURUSD', 'volume': 0.01, 'type': 0, 'price': 1.13437, 'sl': 0.6343700000000001, 'tp': 1.63437, 'deviation': 20, 'magic': 234000, 'comment': 'python script open', 'type_time': 0} >>> >>> # send a trading request >>> result = mt5.order_send(request) >>> result OrderSendResult(retcode=10021, deal=0, order=0, volume=0.0, price=0.0, bid=0.0, ask=0.0, comment='No prices', request_id=0, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='EURUSD', volume=0.01, price=1.13437, stoplimit=0.0, sl=0.6343700000000001, tp=1.63437, deviation=20, type=0, type_filling=0, type_time=0, expiration=0, comment='python script open', position=0, position_by=0)) >>>while all other of times the request is failed...
10021 | There are no quotes to process the request |
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use