
If you’ve been building your own Python trading bot using MetaTrader 5 as your interface, you’ll know that there are times when you need to get all your open orders.
If you need to implement this function, here’s how.
Use this code:
# Function to retrieve all open orders from MT5
def get_open_orders():
orders = MetaTrader5.orders_get()
order_array = []
for order in orders:
order_array.append(order[0])
return order_arrayEnjoy, and don't forget to subscribe for more amazing content
No comments yet