# MT5 Python orders_get()

Independent and unofficial. Not affiliated with or endorsed by any broker or platform named here. Educational only: nothing here is advice, and nothing here recommends a broker or a trade.

This is the markdown version of https://openbrokerapi.com/platforms/metatrader-5/functions/python-orders-get, written from the same records as that page.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Returns the active pending orders on the account: all of them, those in one symbol, those whose symbol matches a filter, or the one with a given ticket.

- Function: `orders_get()`
- Interface: MetaTrader5 Python package
- Group: Orders
- Status: verified. Source: [mql5.com](https://www.mql5.com/en/docs/python_metatrader5/mt5ordersget_py), checked 2026-10-12.

This is a Python function, not an HTTP endpoint. It has no method, no path and no address to send a request to: the package talks to a MetaTrader 5 terminal running on the same computer. It is in no OpenAPI file on this site and the request builder does not list it.

Note: The page shows four forms of the call: with nothing, with symbol, with group and with ticket. Its opening line says three.

## Signature

The 4 forms of the call on the vendor's page, with the vendor's comments taken out.

```python
orders_get()
```

```python
orders_get(
  symbol="SYMBOL"
)
```

```python
orders_get(
  group="GROUP"
)
```

```python
orders_get(
  ticket=TICKET
)
```

## Arguments

- `symbol` (type not stated, optional): A symbol name, to return only that symbol's orders. The page says that when a symbol is given the ticket argument is ignored.
- `group` (type not stated, optional): A filter on symbol names. The page describes it as comma separated conditions, where \* is a wildcard and a leading ! excludes, applied in the order given.
- `ticket` (type not stated, optional): The ticket of one order, the value the page calls ORDER_TICKET.

## Return value

- Type: `tuple of namedtuples, or None`
- What comes back: One named tuple per order. On failure the page says it returns None, and that last_error() gives the reason.

## Sample

Written by this site from the signature and arguments recorded on this page. It has not been run against a terminal, a server or an account, and the values in it are placeholders. No credential is typed into it: where one is needed it is read from an environment variable on your own machine. Nothing is entered on this site.

```python
import MetaTrader5 as mt5

if not mt5.initialize():
    raise SystemExit(f"initialize() failed: {mt5.last_error()}")

orders = mt5.orders_get(symbol="EURUSD")
if orders is None:
    print("orders_get() failed:", mt5.last_error())
else:
    for o in orders:
        print(o.ticket, o.type, o.volume_current, o.price_open)

mt5.shutdown()
```

## Related MT5 Python functions: Orders

- [order_calc_margin()](https://openbrokerapi.com/platforms/metatrader-5/functions/python-order-calc-margin): Works out the margin, in the account's currency, that a trade of a given type, symbol, volume and price would need.
- [order_calc_profit()](https://openbrokerapi.com/platforms/metatrader-5/functions/python-order-calc-profit): Works out the profit or loss, in the account's currency, of a trade opened at one price and closed at another.
- [order_check()](https://openbrokerapi.com/platforms/metatrader-5/functions/python-order-check): Checks whether the account has the funds for a trade request without sending it, and returns what the balance, equity and margin would be.
- [order_send()](https://openbrokerapi.com/platforms/metatrader-5/functions/python-order-send): Sends a trade request from the terminal to the trade server. One call covers a market order, a pending order, a change to an order or position, a cancellation and a close: the request's action field says which.
- [orders_total()](https://openbrokerapi.com/platforms/metatrader-5/functions/python-orders-total): Returns how many pending orders are active on the account.

## More on MetaTrader 5

- [All MetaTrader 5 functions](https://openbrokerapi.com/platforms/metatrader-5/functions): 78 documented here, grouped by what they do.
- [List open orders: the call at each API](https://openbrokerapi.com/endpoints/open-orders): The same job at every broker and platform API recorded here, HTTP or not.
- [MetaTrader 5 API quickstart](https://openbrokerapi.com/platforms/metatrader-5/quickstart)
- [All MetaTrader 5 error codes](https://openbrokerapi.com/errors/mt5)
- [MetaTrader 5 API page](https://openbrokerapi.com/platforms/metatrader-5): The full record: access, authentication, limits and the source for each.

## Licence and how to cite

The records behind this page are all rights reserved. This file is the page itself, at its own address, in another format. It is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data. Quote from it with a link to the page.

Cite as: MT5 Python orders_get(). Broker API Hub, https://openbrokerapi.com/platforms/metatrader-5/functions/python-orders-get, newest check 2026-10-12.

Where you rely on a single figure, cite the source and the checked date printed beside it as well. Where this page and a broker's own documentation differ, the documentation wins.
