# How to Get All Your Open Orders from MetaTrader 5 with Python > MetaTrader 5 Python Trading Bot **Published by:** [The Crypto - AI - Cyber Disruption Continuum](https://paragraph.com/@appnologyjames/) **Published on:** 2024-08-06 **Categories:** python, trading bot, metatrader 5, metatrader, metatrader 5 python trading bot, metatrader 5 exper **URL:** https://paragraph.com/@appnologyjames/how-to-get-all-your-open-orders-from-metatrader-5-with-python ## Content 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.Get Open OrdersMake sure you’ve connected to MetaTrader 5Use 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 contentSubscribe ## Publication Information - [The Crypto - AI - Cyber Disruption Continuum](https://paragraph.com/@appnologyjames/): Publication homepage - [All Posts](https://paragraph.com/@appnologyjames/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@appnologyjames): Subscribe to updates ## Optional - [Collect as NFT](https://paragraph.com/@appnologyjames/how-to-get-all-your-open-orders-from-metatrader-5-with-python): Support the author by collecting this post - [View Collectors](https://paragraph.com/@appnologyjames/how-to-get-all-your-open-orders-from-metatrader-5-with-python/collectors): See who has collected this post