How to properly close an opened order with python? (can't pass a ticket number to “position” when sending an order)
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
From the documentation, I've got this:
but I can't pass anything else than 0 to "position": 0 (line 20), otherwise it will not open the order.
Meantime, if position = 0, it will open an order, I'll get a position ticket from result.order , then I have to manually copy it and paste it in the position from the closing order function, like that it will close the order.
So, is there a way of not manually copying the ticket number after each opened order and paste it in the closing function? Or writing an unique ticket in advance for both, open and close, order?
Thank you in advance!