{
    "openapi": "3.1.0",
    "info": {
        "title": "MT5 API",
        "description": "Starter FastAPI service for MetaTrader 5 integration.",
        "version": "0.1.0"
    },
    "paths": {
        "/health": {
            "get": {
                "tags": [
                    "Health"
                ],
                "summary": "Health check",
                "operationId": "health_health_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HealthResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/account": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Get account information",
                "operationId": "account_account_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccountResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/account/connect": {
            "post": {
                "tags": [
                    "Account"
                ],
                "summary": "Connect to MT5 account",
                "operationId": "connect_account_account_connect_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ConnectAccountRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ConnectionResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/server/info": {
            "get": {
                "tags": [
                    "Server"
                ],
                "summary": "Get server API key and IP address",
                "operationId": "server_info_api_server_info_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServerInfoResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/account/disconnect": {
            "post": {
                "tags": [
                    "Account"
                ],
                "summary": "Disconnect MT5 account",
                "operationId": "disconnect_account_account_disconnect_post",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ConnectionResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tickets": {
            "get": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Get all active tickets",
                "operationId": "tickets_tickets_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TicketsResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/symbols": {
            "get": {
                "tags": [
                    "Symbols"
                ],
                "summary": "Search symbols",
                "operationId": "symbols_symbols_get",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "Optional case-insensitive filter for symbol names.",
                            "title": "Query"
                        },
                        "description": "Optional case-insensitive filter for symbol names."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SymbolsResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/symbols/{name}": {
            "get": {
                "tags": [
                    "Symbols"
                ],
                "summary": "Get symbol details",
                "operationId": "symbol_details_symbols__name__get",
                "parameters": [
                    {
                        "name": "name",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SymbolDetailsResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/quotes/{symbol}": {
            "get": {
                "tags": [
                    "Market Data"
                ],
                "summary": "Get current quote",
                "operationId": "quote_quotes__symbol__get",
                "parameters": [
                    {
                        "name": "symbol",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Symbol"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuoteResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ticks/{symbol}": {
            "get": {
                "tags": [
                    "Market Data"
                ],
                "summary": "Get recent ticks",
                "operationId": "ticks_ticks__symbol__get",
                "parameters": [
                    {
                        "name": "symbol",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Symbol"
                        }
                    },
                    {
                        "name": "count",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 10000,
                            "minimum": 1,
                            "description": "Number of recent ticks to fetch (1..10000).",
                            "default": 100,
                            "title": "Count"
                        },
                        "description": "Number of recent ticks to fetch (1..10000)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TicksResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/market-depth/{symbol}": {
            "get": {
                "tags": [
                    "Market Data"
                ],
                "summary": "Get market depth",
                "operationId": "market_depth_market_depth__symbol__get",
                "parameters": [
                    {
                        "name": "symbol",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Symbol"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/MarketDepthResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/exposure": {
            "get": {
                "tags": [
                    "Positions"
                ],
                "summary": "Get exposure grouped by symbol",
                "operationId": "exposure_exposure_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ExposureResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/exposure/{symbol}": {
            "get": {
                "tags": [
                    "Positions"
                ],
                "summary": "Get exposure for one symbol",
                "operationId": "exposure_symbol_exposure__symbol__get",
                "parameters": [
                    {
                        "name": "symbol",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Symbol"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ExposureItem"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/bars/{symbol}": {
            "get": {
                "tags": [
                    "Market Data"
                ],
                "summary": "Get OHLC bars",
                "operationId": "bars_bars__symbol__get",
                "parameters": [
                    {
                        "name": "symbol",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Symbol"
                        }
                    },
                    {
                        "name": "timeframe",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "Timeframe code (example: M1, M5, H1, D1).",
                            "default": "M1",
                            "title": "Timeframe"
                        },
                        "description": "Timeframe code (example: M1, M5, H1, D1)."
                    },
                    {
                        "name": "n",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 10000,
                            "minimum": 1,
                            "description": "Number of bars to fetch (1..10000).",
                            "default": 100,
                            "title": "N"
                        },
                        "description": "Number of bars to fetch (1..10000)."
                    },
                    {
                        "name": "includeVolume",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "description": "Include tick volume in each bar.",
                            "default": false,
                            "title": "Includevolume"
                        },
                        "description": "Include tick volume in each bar."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BarsResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/bars/{symbol}/range": {
            "get": {
                "tags": [
                    "Market Data"
                ],
                "summary": "Get OHLC bars in a datetime range",
                "operationId": "bars_range_bars__symbol__range_get",
                "parameters": [
                    {
                        "name": "symbol",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Symbol"
                        }
                    },
                    {
                        "name": "fromDate",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "Start ISO datetime (UTC recommended).",
                            "title": "Fromdate"
                        },
                        "description": "Start ISO datetime (UTC recommended)."
                    },
                    {
                        "name": "toDate",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "End ISO datetime (UTC recommended).",
                            "title": "Todate"
                        },
                        "description": "End ISO datetime (UTC recommended)."
                    },
                    {
                        "name": "timeframe",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "Timeframe code (example: M1, M5, H1, D1).",
                            "default": "M1",
                            "title": "Timeframe"
                        },
                        "description": "Timeframe code (example: M1, M5, H1, D1)."
                    },
                    {
                        "name": "includeVolume",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "description": "Include tick volume in each bar.",
                            "default": false,
                            "title": "Includevolume"
                        },
                        "description": "Include tick volume in each bar."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BarsRangeResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders": {
            "post": {
                "tags": [
                    "Orders"
                ],
                "summary": "Create an order",
                "operationId": "create_order_orders_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateOrderRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OrderExecutionResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/positions/open": {
            "get": {
                "tags": [
                    "Positions"
                ],
                "summary": "List open positions",
                "operationId": "open_positions_positions_open_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OpenPositionsResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/positions/{ticket}/details": {
            "get": {
                "tags": [
                    "Positions"
                ],
                "summary": "Get open position details with stop loss and take profit values",
                "operationId": "position_details_positions__ticket__details_get",
                "parameters": [
                    {
                        "name": "ticket",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "title": "Ticket"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PositionDetailsResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/positions/modify": {
            "post": {
                "tags": [
                    "Positions"
                ],
                "summary": "Modify stop loss and take profit for an open position",
                "operationId": "modify_position_positions_modify_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ModifyPositionStopsRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModifyPositionStopsResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/positions/adjust-by-money": {
            "post": {
                "tags": [
                    "Positions"
                ],
                "summary": "Adjust stop loss and take profit for an open position by money values",
                "operationId": "adjust_position_by_money_positions_adjust_by_money_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdjustPositionStopsByMoneyRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AdjustPositionStopsByMoneyResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/pending": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "List pending orders",
                "operationId": "pending_orders_orders_pending_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PendingOrdersResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/news-close/jobs": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "List orders and positions watched for news-close",
                "operationId": "news_close_jobs_orders_news_close_jobs_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NewsCloseJobsResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/trades/history": {
            "get": {
                "tags": [
                    "Trades"
                ],
                "summary": "Get trade history",
                "operationId": "trade_history_trades_history_get",
                "parameters": [
                    {
                        "name": "fromDate",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "Start ISO datetime (UTC recommended).",
                            "title": "Fromdate"
                        },
                        "description": "Start ISO datetime (UTC recommended)."
                    },
                    {
                        "name": "toDate",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "End ISO datetime (UTC recommended).",
                            "title": "Todate"
                        },
                        "description": "End ISO datetime (UTC recommended)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TradeHistoryResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/calendar/events": {
            "get": {
                "tags": [
                    "Calendar"
                ],
                "summary": "Get calendar events",
                "operationId": "calendar_events_calendar_events_get",
                "parameters": [
                    {
                        "name": "fromDate",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "Start ISO datetime (UTC recommended).",
                            "title": "Fromdate"
                        },
                        "description": "Start ISO datetime (UTC recommended)."
                    },
                    {
                        "name": "toDate",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "End ISO datetime (UTC recommended).",
                            "title": "Todate"
                        },
                        "description": "End ISO datetime (UTC recommended)."
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "Optional country/currency code filter (example: USD).",
                            "title": "Country"
                        },
                        "description": "Optional country/currency code filter (example: USD)."
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "Optional currency filter (example: USD).",
                            "title": "Currency"
                        },
                        "description": "Optional currency filter (example: USD)."
                    },
                    {
                        "name": "impact",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "Optional impact filter: Low, Medium, High, or Holiday.",
                            "title": "Impact"
                        },
                        "description": "Optional impact filter: Low, Medium, High, or Holiday."
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "Calendar source: fairEconomy (default) or mt5.",
                            "default": "fairEconomy",
                            "title": "Source"
                        },
                        "description": "Calendar source: fairEconomy (default) or mt5."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CalendarEventsResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/close": {
            "post": {
                "tags": [
                    "Orders"
                ],
                "summary": "Close position or cancel pending order",
                "operationId": "close_order_orders_close_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CloseOrderRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CloseOrderResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ws/positions/open/docs": {
            "get": {
                "tags": [
                    "WebSocket Docs"
                ],
                "summary": "WebSocket docs: open positions stream",
                "operationId": "ws_positions_open_docs_ws_positions_open_docs_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebSocketDocsResponse"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "AccountResponse": {
                "properties": {
                    "account": {
                        "additionalProperties": true,
                        "type": "object",
                        "title": "Account",
                        "description": "Account payload from MT5. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "account"
                ],
                "title": "AccountResponse"
            },
            "AdjustPositionStopsByMoneyRequest": {
                "properties": {
                    "ticket": {
                        "type": "integer",
                        "exclusiveMinimum": 0.0,
                        "title": "Ticket",
                        "description": "Open position ticket to adjust."
                    },
                    "stopLossValueInMoney": {
                        "type": "number",
                        "exclusiveMinimum": 0.0,
                        "title": "Stoplossvalueinmoney",
                        "description": "Desired stop loss value in account currency.",
                        "default": 10.0
                    },
                    "takeProfitValueInMoney": {
                        "anyOf": [
                            {
                                "type": "number",
                                "exclusiveMinimum": 0.0
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Takeprofitvalueinmoney",
                        "description": "Desired take profit value in account currency."
                    },
                    "takeProfilValueInMoney": {
                        "anyOf": [
                            {
                                "type": "number",
                                "exclusiveMinimum": 0.0
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Takeprofilvalueinmoney",
                        "description": "Deprecated typo alias for takeProfitValueInMoney."
                    },
                    "comment": {
                        "type": "string",
                        "title": "Comment",
                        "description": "Comment attached to the modification.",
                        "default": "api-adjust-position-money"
                    }
                },
                "type": "object",
                "required": [
                    "ticket"
                ],
                "title": "AdjustPositionStopsByMoneyRequest"
            },
            "AdjustPositionStopsByMoneyResponse": {
                "properties": {
                    "operation": {
                        "type": "string",
                        "title": "Operation",
                        "description": "Executed operation type: adjustPositionStopsByMoney."
                    },
                    "retcode": {
                        "type": "integer",
                        "title": "Retcode",
                        "description": "MT5 return code."
                    },
                    "success": {
                        "type": "boolean",
                        "title": "Success",
                        "description": "True when MT5 reports successful execution."
                    },
                    "message": {
                        "type": "string",
                        "title": "Message",
                        "description": "MT5 execution message."
                    },
                    "ticket": {
                        "type": "integer",
                        "title": "Ticket",
                        "description": "Open position ticket."
                    },
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Trading symbol."
                    },
                    "side": {
                        "type": "string",
                        "title": "Side",
                        "description": "Position side: buy or sell."
                    },
                    "entryPrice": {
                        "type": "number",
                        "title": "Entryprice",
                        "description": "Position entry/open price."
                    },
                    "stopLossPrice": {
                        "type": "number",
                        "title": "Stoplossprice",
                        "description": "Calculated and submitted stop loss price."
                    },
                    "takeProfitPrice": {
                        "type": "number",
                        "title": "Takeprofitprice",
                        "description": "Calculated and submitted take profit price."
                    },
                    "volume": {
                        "type": "number",
                        "title": "Volume",
                        "description": "Position lot size."
                    },
                    "contractSize": {
                        "type": "number",
                        "title": "Contractsize",
                        "description": "Symbol trade contract size used for value calculation."
                    },
                    "priceStep": {
                        "type": "number",
                        "title": "Pricestep",
                        "description": "Symbol price step used to round requested money values down."
                    },
                    "requestedStopLossValueInMoney": {
                        "type": "number",
                        "title": "Requestedstoplossvalueinmoney",
                        "description": "Requested stop loss value in account currency."
                    },
                    "requestedTakeProfitValueInMoney": {
                        "type": "number",
                        "title": "Requestedtakeprofitvalueinmoney",
                        "description": "Requested take profit value in account currency."
                    },
                    "stopLossValueInMoney": {
                        "type": "number",
                        "title": "Stoplossvalueinmoney",
                        "description": "Actual stop loss value after price-step rounding."
                    },
                    "takeProfitValueInMoney": {
                        "type": "number",
                        "title": "Takeprofitvalueinmoney",
                        "description": "Actual take profit value after price-step rounding."
                    },
                    "result": {
                        "additionalProperties": true,
                        "type": "object",
                        "title": "Result",
                        "description": "Raw MT5 modify result. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "operation",
                    "retcode",
                    "success",
                    "message",
                    "ticket",
                    "symbol",
                    "side",
                    "entryPrice",
                    "stopLossPrice",
                    "takeProfitPrice",
                    "volume",
                    "contractSize",
                    "priceStep",
                    "requestedStopLossValueInMoney",
                    "requestedTakeProfitValueInMoney",
                    "stopLossValueInMoney",
                    "takeProfitValueInMoney",
                    "result"
                ],
                "title": "AdjustPositionStopsByMoneyResponse"
            },
            "BarItem": {
                "properties": {
                    "time": {
                        "type": "string",
                        "title": "Time",
                        "description": "Bar timestamp in ISO-8601 format (UTC)."
                    },
                    "open": {
                        "type": "number",
                        "title": "Open",
                        "description": "Open price."
                    },
                    "high": {
                        "type": "number",
                        "title": "High",
                        "description": "High price."
                    },
                    "low": {
                        "type": "number",
                        "title": "Low",
                        "description": "Low price."
                    },
                    "close": {
                        "type": "number",
                        "title": "Close",
                        "description": "Close price."
                    },
                    "volume": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Volume",
                        "description": "Tick volume when includeVolume=true."
                    }
                },
                "type": "object",
                "required": [
                    "time",
                    "open",
                    "high",
                    "low",
                    "close"
                ],
                "title": "BarItem"
            },
            "BarsRangeResponse": {
                "properties": {
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Symbol used in the query."
                    },
                    "timeframe": {
                        "type": "string",
                        "title": "Timeframe",
                        "description": "Requested timeframe."
                    },
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of bars returned."
                    },
                    "bars": {
                        "items": {
                            "$ref": "#/components/schemas/BarItem"
                        },
                        "type": "array",
                        "title": "Bars",
                        "description": "OHLC bars."
                    },
                    "fromDate": {
                        "type": "string",
                        "title": "Fromdate",
                        "description": "Start datetime used for the bars query (ISO-8601, UTC)."
                    },
                    "toDate": {
                        "type": "string",
                        "title": "Todate",
                        "description": "End datetime used for the bars query (ISO-8601, UTC)."
                    }
                },
                "type": "object",
                "required": [
                    "symbol",
                    "timeframe",
                    "count",
                    "bars",
                    "fromDate",
                    "toDate"
                ],
                "title": "BarsRangeResponse"
            },
            "BarsResponse": {
                "properties": {
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Symbol used in the query."
                    },
                    "timeframe": {
                        "type": "string",
                        "title": "Timeframe",
                        "description": "Requested timeframe."
                    },
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of bars returned."
                    },
                    "bars": {
                        "items": {
                            "$ref": "#/components/schemas/BarItem"
                        },
                        "type": "array",
                        "title": "Bars",
                        "description": "OHLC bars."
                    }
                },
                "type": "object",
                "required": [
                    "symbol",
                    "timeframe",
                    "count",
                    "bars"
                ],
                "title": "BarsResponse"
            },
            "CalendarEventsResponse": {
                "properties": {
                    "source": {
                        "type": "string",
                        "title": "Source",
                        "description": "Calendar data source: fairEconomy or mt5."
                    },
                    "fromDate": {
                        "type": "string",
                        "title": "Fromdate",
                        "description": "Start datetime used for calendar query (ISO-8601, UTC)."
                    },
                    "toDate": {
                        "type": "string",
                        "title": "Todate",
                        "description": "End datetime used for calendar query (ISO-8601, UTC)."
                    },
                    "country": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Country",
                        "description": "Country filter used in query."
                    },
                    "currency": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Currency",
                        "description": "Currency filter used in query."
                    },
                    "impact": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Impact",
                        "description": "Fair Economy impact filter."
                    },
                    "cachedAt": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Cachedat",
                        "description": "Time the Fair Economy cache was fetched."
                    },
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of calendar events returned."
                    },
                    "events": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Events",
                        "description": "Calendar event entries."
                    }
                },
                "type": "object",
                "required": [
                    "source",
                    "fromDate",
                    "toDate",
                    "count",
                    "events"
                ],
                "title": "CalendarEventsResponse"
            },
            "CloseOrderRequest": {
                "properties": {
                    "ticket": {
                        "type": "integer",
                        "exclusiveMinimum": 0.0,
                        "title": "Ticket",
                        "description": "Position/order ticket to close or cancel."
                    },
                    "volume": {
                        "anyOf": [
                            {
                                "type": "number",
                                "exclusiveMinimum": 0.0
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Volume",
                        "description": "Partial close volume. If omitted, closes full position size."
                    },
                    "deviation": {
                        "type": "integer",
                        "minimum": 0.0,
                        "title": "Deviation",
                        "description": "Maximum slippage in points.",
                        "default": 20
                    },
                    "comment": {
                        "type": "string",
                        "title": "Comment",
                        "description": "Comment attached to close/cancel operation.",
                        "default": "api-close"
                    }
                },
                "type": "object",
                "required": [
                    "ticket"
                ],
                "title": "CloseOrderRequest"
            },
            "CloseOrderResponse": {
                "properties": {
                    "operation": {
                        "type": "string",
                        "title": "Operation",
                        "description": "Executed operation type: closePosition or cancelPendingOrder."
                    },
                    "retcode": {
                        "type": "integer",
                        "title": "Retcode",
                        "description": "MT5 return code."
                    },
                    "success": {
                        "type": "boolean",
                        "title": "Success",
                        "description": "True when MT5 reports successful execution."
                    },
                    "result": {
                        "additionalProperties": true,
                        "type": "object",
                        "title": "Result",
                        "description": "Raw MT5 close/cancel result. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "operation",
                    "retcode",
                    "success",
                    "result"
                ],
                "title": "CloseOrderResponse"
            },
            "ConnectAccountRequest": {
                "properties": {
                    "username": {
                        "type": "string",
                        "title": "Username",
                        "description": "MT5 account login/username (numeric)."
                    },
                    "password": {
                        "type": "string",
                        "title": "Password",
                        "description": "MT5 account password."
                    },
                    "server": {
                        "type": "string",
                        "title": "Server",
                        "description": "MT5 broker server name."
                    },
                    "path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Path",
                        "description": "Optional MT5 terminal executable path."
                    },
                    "portable": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Portable",
                        "description": "Use MT5 portable mode for the configured terminal path."
                    },
                    "account": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Account",
                        "description": "Expected MT5 account number after connection. Defaults to username."
                    }
                },
                "type": "object",
                "required": [
                    "username",
                    "password",
                    "server"
                ],
                "title": "ConnectAccountRequest"
            },
            "ConnectionResponse": {
                "properties": {
                    "success": {
                        "type": "boolean",
                        "title": "Success",
                        "description": "True when MT5 connect/disconnect action succeeds."
                    },
                    "mt5": {
                        "type": "string",
                        "title": "Mt5",
                        "description": "Connection status or error message."
                    }
                },
                "type": "object",
                "required": [
                    "success",
                    "mt5"
                ],
                "title": "ConnectionResponse"
            },
            "CreateOrderRequest": {
                "properties": {
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Trading symbol (example: EURUSD)."
                    },
                    "side": {
                        "type": "string",
                        "title": "Side",
                        "description": "Order side. Allowed values: buy, sell.",
                        "examples": [
                            "buy"
                        ]
                    },
                    "volume": {
                        "type": "number",
                        "exclusiveMinimum": 0.0,
                        "title": "Volume",
                        "description": "Order lot size."
                    },
                    "orderType": {
                        "type": "string",
                        "title": "Ordertype",
                        "description": "Order type. Allowed values: market, limit, stop, stopLimit.",
                        "default": "market",
                        "examples": [
                            "market"
                        ]
                    },
                    "price": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Price",
                        "description": "Trigger/entry price. Required for limit, stop, and stopLimit."
                    },
                    "stopLimit": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stoplimit",
                        "description": "Stop-limit price. Required only when orderType is stopLimit."
                    },
                    "deviation": {
                        "type": "integer",
                        "minimum": 0.0,
                        "title": "Deviation",
                        "description": "Maximum slippage in points.",
                        "default": 20
                    },
                    "sl": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Sl",
                        "description": "Stop loss price."
                    },
                    "tp": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Tp",
                        "description": "Take profit price."
                    },
                    "magic": {
                        "type": "integer",
                        "title": "Magic",
                        "description": "Client strategy identifier (magic number).",
                        "default": 0
                    },
                    "comment": {
                        "type": "string",
                        "title": "Comment",
                        "description": "Comment attached to the order.",
                        "default": "api-order"
                    },
                    "closeOnNews": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Closeonnews",
                        "description": "Optional news-close policy, for example M15_High or M5_Low."
                    }
                },
                "type": "object",
                "required": [
                    "symbol",
                    "side",
                    "volume"
                ],
                "title": "CreateOrderRequest"
            },
            "ExposureItem": {
                "properties": {
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Symbol name."
                    },
                    "positionsCount": {
                        "type": "integer",
                        "title": "Positionscount",
                        "description": "Number of open positions on this symbol."
                    },
                    "buyVolume": {
                        "type": "number",
                        "title": "Buyvolume",
                        "description": "Total open buy volume."
                    },
                    "sellVolume": {
                        "type": "number",
                        "title": "Sellvolume",
                        "description": "Total open sell volume."
                    },
                    "netVolume": {
                        "type": "number",
                        "title": "Netvolume",
                        "description": "Buy volume minus sell volume."
                    },
                    "pendingBuyVolume": {
                        "type": "number",
                        "title": "Pendingbuyvolume",
                        "description": "Total pending buy-side volume."
                    },
                    "pendingSellVolume": {
                        "type": "number",
                        "title": "Pendingsellvolume",
                        "description": "Total pending sell-side volume."
                    },
                    "profit": {
                        "type": "number",
                        "title": "Profit",
                        "description": "Current aggregated open profit for the symbol."
                    }
                },
                "type": "object",
                "required": [
                    "symbol",
                    "positionsCount",
                    "buyVolume",
                    "sellVolume",
                    "netVolume",
                    "pendingBuyVolume",
                    "pendingSellVolume",
                    "profit"
                ],
                "title": "ExposureItem"
            },
            "ExposureResponse": {
                "properties": {
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of symbols with exposure entries."
                    },
                    "exposures": {
                        "items": {
                            "$ref": "#/components/schemas/ExposureItem"
                        },
                        "type": "array",
                        "title": "Exposures",
                        "description": "Exposure summary grouped by symbol."
                    }
                },
                "type": "object",
                "required": [
                    "count",
                    "exposures"
                ],
                "title": "ExposureResponse"
            },
            "HTTPValidationError": {
                "properties": {
                    "detail": {
                        "items": {
                            "$ref": "#/components/schemas/ValidationError"
                        },
                        "type": "array",
                        "title": "Detail"
                    }
                },
                "type": "object",
                "title": "HTTPValidationError"
            },
            "HealthResponse": {
                "properties": {
                    "status": {
                        "type": "string",
                        "title": "Status",
                        "description": "API health indicator."
                    },
                    "mt5": {
                        "type": "string",
                        "title": "Mt5",
                        "description": "MT5 connection status or error message."
                    }
                },
                "type": "object",
                "required": [
                    "status",
                    "mt5"
                ],
                "title": "HealthResponse"
            },
            "MarketDepthResponse": {
                "properties": {
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Symbol used in the query."
                    },
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of depth levels returned."
                    },
                    "items": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Items",
                        "description": "Depth levels with type, price, and volume."
                    }
                },
                "type": "object",
                "required": [
                    "symbol",
                    "count",
                    "items"
                ],
                "title": "MarketDepthResponse"
            },
            "ModifyPositionStopsRequest": {
                "properties": {
                    "ticket": {
                        "type": "integer",
                        "exclusiveMinimum": 0.0,
                        "title": "Ticket",
                        "description": "Open position ticket to modify."
                    },
                    "sl": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Sl",
                        "description": "New stop loss price. If omitted, the current stop loss is kept."
                    },
                    "tp": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Tp",
                        "description": "New take profit price. If omitted, the current take profit is kept."
                    },
                    "comment": {
                        "type": "string",
                        "title": "Comment",
                        "description": "Comment attached to the modification.",
                        "default": "api-modify-position"
                    }
                },
                "type": "object",
                "required": [
                    "ticket"
                ],
                "title": "ModifyPositionStopsRequest"
            },
            "ModifyPositionStopsResponse": {
                "properties": {
                    "operation": {
                        "type": "string",
                        "title": "Operation",
                        "description": "Executed operation type: modifyPositionStops."
                    },
                    "retcode": {
                        "type": "integer",
                        "title": "Retcode",
                        "description": "MT5 return code."
                    },
                    "success": {
                        "type": "boolean",
                        "title": "Success",
                        "description": "True when MT5 reports successful execution."
                    },
                    "message": {
                        "type": "string",
                        "title": "Message",
                        "description": "MT5 execution message."
                    },
                    "result": {
                        "additionalProperties": true,
                        "type": "object",
                        "title": "Result",
                        "description": "Raw MT5 modify result. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "operation",
                    "retcode",
                    "success",
                    "message",
                    "result"
                ],
                "title": "ModifyPositionStopsResponse"
            },
            "NewsCloseJobsResponse": {
                "properties": {
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of active news-close jobs."
                    },
                    "jobs": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Jobs",
                        "description": "Stored positions and pending orders watched for news-close."
                    }
                },
                "type": "object",
                "required": [
                    "count",
                    "jobs"
                ],
                "title": "NewsCloseJobsResponse"
            },
            "OpenPositionsResponse": {
                "properties": {
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of open positions."
                    },
                    "positions": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Positions",
                        "description": "Open positions payload. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "count",
                    "positions"
                ],
                "title": "OpenPositionsResponse"
            },
            "OrderExecutionResponse": {
                "properties": {
                    "retcode": {
                        "type": "integer",
                        "title": "Retcode",
                        "description": "MT5 return code."
                    },
                    "success": {
                        "type": "boolean",
                        "title": "Success",
                        "description": "True when MT5 reports successful execution."
                    },
                    "message": {
                        "type": "string",
                        "title": "Message",
                        "description": "MT5 execution message."
                    },
                    "hint": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Hint",
                        "description": "Actionable hint when available."
                    },
                    "result": {
                        "additionalProperties": true,
                        "type": "object",
                        "title": "Result",
                        "description": "Raw MT5 execution result. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "retcode",
                    "success",
                    "message",
                    "result"
                ],
                "title": "OrderExecutionResponse"
            },
            "PendingOrdersResponse": {
                "properties": {
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of pending orders."
                    },
                    "orders": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Orders",
                        "description": "Pending orders payload. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "count",
                    "orders"
                ],
                "title": "PendingOrdersResponse"
            },
            "PositionDetailsResponse": {
                "properties": {
                    "ticket": {
                        "type": "integer",
                        "title": "Ticket",
                        "description": "Open position ticket."
                    },
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Trading symbol."
                    },
                    "side": {
                        "type": "string",
                        "title": "Side",
                        "description": "Position side: buy or sell."
                    },
                    "entryPrice": {
                        "type": "number",
                        "title": "Entryprice",
                        "description": "Position entry/open price."
                    },
                    "stopLossPrice": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stoplossprice",
                        "description": "Current stop loss price, or null when not set."
                    },
                    "takeProfitPrice": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Takeprofitprice",
                        "description": "Current take profit price, or null when not set."
                    },
                    "volume": {
                        "type": "number",
                        "title": "Volume",
                        "description": "Position lot size."
                    },
                    "contractSize": {
                        "type": "number",
                        "title": "Contractsize",
                        "description": "Symbol trade contract size used for value calculation."
                    },
                    "stopLossValue": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stoplossvalue",
                        "description": "Directional SL value: price distance * volume * contract size."
                    },
                    "takeProfitValue": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Takeprofitvalue",
                        "description": "Directional TP value: price distance * volume * contract size."
                    },
                    "position": {
                        "additionalProperties": true,
                        "type": "object",
                        "title": "Position",
                        "description": "Raw MT5 position payload. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "ticket",
                    "symbol",
                    "side",
                    "entryPrice",
                    "volume",
                    "contractSize",
                    "position"
                ],
                "title": "PositionDetailsResponse"
            },
            "QuoteResponse": {
                "properties": {
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Symbol used in the query."
                    },
                    "time": {
                        "type": "string",
                        "title": "Time",
                        "description": "Tick timestamp in ISO-8601 format (UTC)."
                    },
                    "bid": {
                        "type": "number",
                        "title": "Bid",
                        "description": "Current bid price."
                    },
                    "ask": {
                        "type": "number",
                        "title": "Ask",
                        "description": "Current ask price."
                    },
                    "last": {
                        "type": "number",
                        "title": "Last",
                        "description": "Last traded price when available."
                    },
                    "spread": {
                        "type": "number",
                        "title": "Spread",
                        "description": "Ask minus bid."
                    },
                    "volume": {
                        "type": "number",
                        "title": "Volume",
                        "description": "Current tick volume."
                    }
                },
                "type": "object",
                "required": [
                    "symbol",
                    "time",
                    "bid",
                    "ask",
                    "last",
                    "spread",
                    "volume"
                ],
                "title": "QuoteResponse"
            },
            "ServerInfoResponse": {
                "properties": {
                    "mode": {
                        "type": "string",
                        "title": "Mode",
                        "description": "Current server access mode."
                    },
                    "apiKey": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Apikey",
                        "description": "Locally stored server API key."
                    },
                    "ipAddress": {
                        "type": "string",
                        "title": "Ipaddress",
                        "description": "Detected machine IPv4 address."
                    }
                },
                "type": "object",
                "required": [
                    "mode",
                    "ipAddress"
                ],
                "title": "ServerInfoResponse"
            },
            "SymbolDetailsResponse": {
                "properties": {
                    "symbol": {
                        "additionalProperties": true,
                        "type": "object",
                        "title": "Symbol",
                        "description": "Detailed symbol attributes from MT5. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "symbol"
                ],
                "title": "SymbolDetailsResponse"
            },
            "SymbolsResponse": {
                "properties": {
                    "query": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Query",
                        "description": "Search filter used for symbols."
                    },
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of symbols returned."
                    },
                    "symbols": {
                        "items": {
                            "type": "string"
                        },
                        "type": "array",
                        "title": "Symbols",
                        "description": "List of symbol names."
                    }
                },
                "type": "object",
                "required": [
                    "count",
                    "symbols"
                ],
                "title": "SymbolsResponse"
            },
            "TicketsResponse": {
                "properties": {
                    "positionTickets": {
                        "items": {
                            "type": "integer"
                        },
                        "type": "array",
                        "title": "Positiontickets",
                        "description": "Open position ticket IDs."
                    },
                    "orderTickets": {
                        "items": {
                            "type": "integer"
                        },
                        "type": "array",
                        "title": "Ordertickets",
                        "description": "Pending order ticket IDs."
                    },
                    "total": {
                        "type": "integer",
                        "title": "Total",
                        "description": "Total number of tickets."
                    }
                },
                "type": "object",
                "required": [
                    "positionTickets",
                    "orderTickets",
                    "total"
                ],
                "title": "TicketsResponse"
            },
            "TicksResponse": {
                "properties": {
                    "symbol": {
                        "type": "string",
                        "title": "Symbol",
                        "description": "Symbol used in the query."
                    },
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of ticks returned."
                    },
                    "ticks": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Ticks",
                        "description": "Recent ticks with bid, ask, last, volume, and flags."
                    }
                },
                "type": "object",
                "required": [
                    "symbol",
                    "count",
                    "ticks"
                ],
                "title": "TicksResponse"
            },
            "TradeHistoryResponse": {
                "properties": {
                    "fromDate": {
                        "type": "string",
                        "title": "Fromdate",
                        "description": "Start datetime used for history query (ISO-8601, UTC)."
                    },
                    "toDate": {
                        "type": "string",
                        "title": "Todate",
                        "description": "End datetime used for history query (ISO-8601, UTC)."
                    },
                    "count": {
                        "type": "integer",
                        "title": "Count",
                        "description": "Number of trade records returned."
                    },
                    "trades": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Trades",
                        "description": "Historical deal records from MT5. Keys are camelCase."
                    }
                },
                "type": "object",
                "required": [
                    "fromDate",
                    "toDate",
                    "count",
                    "trades"
                ],
                "title": "TradeHistoryResponse"
            },
            "ValidationError": {
                "properties": {
                    "loc": {
                        "items": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "integer"
                                }
                            ]
                        },
                        "type": "array",
                        "title": "Location"
                    },
                    "msg": {
                        "type": "string",
                        "title": "Message"
                    },
                    "type": {
                        "type": "string",
                        "title": "Error Type"
                    },
                    "input": {
                        "title": "Input"
                    },
                    "ctx": {
                        "type": "object",
                        "title": "Context"
                    }
                },
                "type": "object",
                "required": [
                    "loc",
                    "msg",
                    "type"
                ],
                "title": "ValidationError"
            },
            "WebSocketDocsResponse": {
                "properties": {
                    "stream": {
                        "type": "string",
                        "title": "Stream",
                        "description": "Logical stream name."
                    },
                    "websocketPath": {
                        "type": "string",
                        "title": "Websocketpath",
                        "description": "Relative WebSocket path."
                    },
                    "websocketExampleUrl": {
                        "type": "string",
                        "title": "Websocketexampleurl",
                        "description": "Example URL to connect from a client."
                    },
                    "queryParams": {
                        "additionalProperties": {
                            "type": "string"
                        },
                        "type": "object",
                        "title": "Queryparams",
                        "description": "Supported query parameters and value constraints."
                    },
                    "events": {
                        "items": {
                            "type": "string"
                        },
                        "type": "array",
                        "title": "Events",
                        "description": "Event types emitted by the stream."
                    },
                    "sampleMessages": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Samplemessages",
                        "description": "Sample messages sent by the server."
                    }
                },
                "type": "object",
                "required": [
                    "stream",
                    "websocketPath",
                    "websocketExampleUrl",
                    "queryParams",
                    "events",
                    "sampleMessages"
                ],
                "title": "WebSocketDocsResponse"
            }
        }
    },
    "tags": [
        {
            "name": "Health",
            "description": "Service and MT5 connection status."
        },
        {
            "name": "Account",
            "description": "Account information endpoints."
        },
        {
            "name": "Tickets",
            "description": "Active position and order tickets."
        },
        {
            "name": "Symbols",
            "description": "Symbol search and metadata."
        },
        {
            "name": "Market Data",
            "description": "Historical market bars."
        },
        {
            "name": "Orders",
            "description": "Order creation, pending orders, and close/cancel."
        },
        {
            "name": "Positions",
            "description": "Open position endpoints."
        },
        {
            "name": "Trades",
            "description": "Trade history endpoints."
        },
        {
            "name": "Calendar",
            "description": "Economic calendar endpoints."
        },
        {
            "name": "Server",
            "description": "Server configuration and identity endpoints."
        },
        {
            "name": "WebSocket Docs",
            "description": "Swagger-visible docs for WebSocket streams."
        }
    ]
}