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
Hello,
I’m trying to use the ‘send_order’ function from the MT5 documentation but it doesn’t seem to be working. I keep getting the same return value from using the ‘send_order’ function with no success.
Here’s my code:
Here’s my output:
program started
OrderSendResult(retcode=10027, deal=0, order=0, volume=0.0, price=0.0, bid=0.0, ask=0.0, comment='AutoTrading disabled by client', request_id=0, retcode_external=0, request=TradeRequest(action=1, magic=0, order=0, symbol='USDCAD', volume=0.1, price=1.36429, stoplimit=0.0, sl=0.0, tp=0.0, deviation=0, type=0, type_filling=2, type_time=0, expiration=0, comment='', position=0, position_by=0))
From what I understand "retcode=10027" along with the " AutoTrading disabled by client" comment means it's disabled but I've enabled it and I think I turned on all the needed/possible Expert Advisor permissions as can be seen in the attached screenshots.
The initialization was done properly from what I can tell as other functions such as 'positions_get', 'account_info', and 'copy_rates_from' are working. Something to add though is 'Close' wasn't working which is meant to close an active position but that may be because of another problem, I don't for sure.
I’ve tried copy-pasting the entire documentation code demo to see if that worked but it threw the same error. I've messed around with the charts, seeing if that affects the function as documentation has an if-statement that checks if it's open. I've tried it with the chart being open and closed but both times gave the same output.
Any help would be greatly appreciated, thank you!