Skip to main content
Glama

metatrader-mcp-server

get_orders.md1.06 kB
# get_orders 📜 **Signature:** ```python def get_orders( connection, from_date: Optional[datetime] = None, to_date: Optional[datetime] = None, group: Optional[str] = None, ticket: Optional[int] = None ) -> List[Dict[str, Any]] ``` ## What does it do? Fetches historical orders from MetaTrader 5. You can filter by date, group, or ticket. Returns a list of order dictionaries. ## Parameters - **connection**: Your MetaTrader 5 connection object (must be connected!) - **from_date**: Start date for history (default: 30 days ago) - **to_date**: End date for history (default: now) - **group**: (Optional) Filter by group - **ticket**: (Optional) Filter by ticket number ## Returns - **List[Dict[str, Any]]**: List of orders as dictionaries. ## Raises - `ConnectionError` if not connected - `OrdersHistoryError` if MetaTrader 5 errors occur ## Example Usage ```python from metatrader_client.history import get_orders orders = get_orders(conn, from_date, to_date) ``` --- ✨ _No orders? No worries, you’ll get an empty list!_

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ariadng/metatrader-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server