"for position in positions" is Python code, does that work in mql also now?
josip2247: I would like to close all pending orders in same time. i tried with open positions and succeeded but dont now how to do with open pending orders. this is my code for open positions:
You don't close Orders, you remove them with the "TRADE_ACTION_REMOVE" action.
You also have to get them from the Orders and not the Positions, using orders_get, from the total orders available with orders_total.
EDIT: Please note that the links I have provided are for Python code integration, given that your code sample is in Python.
Thank you!
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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 would like to close all pending orders in same time.
i tried with open positions and succeeded but dont now how to do with open pending orders.
this is my code for open positions: