1. Please insert the code correctly: when editing a message, press the button and paste your code into the pop-up window
2. Read the examples from the documentation: order_send
- www.mql5.com
1. Please insert the code correctly: when editing a message, press the button and paste your code into the pop-up window
2. Read the examples from the documentation: order_send
Thank, I'm using these settings, that equal to my active Order (I was get them from the result of positions_get() function):
"action": mt5.TRADE_ACTION_DEAL, "symbol": Symbol, "volume": Order.volume, "type": mt5.ORDER_TYPE_BUY, "position": Order.ticket, "price": Order.price_current, "deviation": 5, "magic": 234000, "comment": "python script close", "type_time": mt5.ORDER_TIME_GTC, "type_filling": mt5.ORDER_FILLING_RETURN,
But get retcode=10013
Request data:
request=TradeRequest( action=1, magic=234000, order=0, symbol='GBPSGD', volume=0.01, price=1.79088, stoplimit=0.0, sl=0.0, tp=0.0, deviation=5, type=0, type_filling=2, type_time=0, expiration=0, comment='python script close', position=242265476, position_by=0 )
I was get equal retcode=10013 within:
price=mt5.symbol_info_tick(Symbol).bid
nothing changes
I not understand how it's works ...wow, it's works ... But need use "type" = ORDER_TYPE_SELL for "BUY" orders ... Need to set mirror value of really order
"action": mt5.TRADE_ACTION_DEAL, "symbol": Symbol, "volume": Order.volume, "type": mt5.ORDER_TYPE_SELL, "position": Order.ticket, "price": Order.price_current, #mt5.symbol_info_tick(Symbol).bid "deviation": 20, "magic": 234000, "type_time": mt5.ORDER_TIME_GTC, "type_filling": mt5.ORDER_FILLING_IOC,
wow, it's works ... But need use "type" = ORDER_TYPE_SELL for "BUY" orders ... Need to set mirror value of really order
I told you - take an example from the documentation :) . But you decided to go your own way - by trial and error :)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
plz, who know about - write example of these ... It's my current setting, but it's only for pending orders ...