Skip to content

Get all orders

The get_all_orders function returns a list of all orders. This is useful if you want to check if there are any pending orders or if you want to check if there are any failed orders.

Method

tm.get_all_orders()

Inputs

None

Outputs

List of all orders.

Example usage

strategy.py
import tradomate as tm
@tm.strategy()
def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# ... Your strategy code here
# Get all orders
orders = tm.get_all_orders()
# Print the number of orders
tm.log(f"Orders: {len(orders)}")