Overview
NOVOSKY does not use the MetaTrader5 Python package. All broker communication goes through a self-hosted HTTP API running on your MT5 server. Base URL:https://terminal-one.novosky.app (or your own self-hosted instance)
OpenAPI spec: /openapi.json
Authentication: Bearer token in the Authorization header.
API_TOKEN in your .env to match the token configured on the server. The /ping endpoint is the only one that skips authentication.
Endpoint groups
The API is organized into seven tag groups — all auto-generated in the sidebar:| Group | Endpoints | Description |
|---|---|---|
| System | /ping, /ping/broker, /error | Health, broker latency, last error |
| Terminal | /terminal, /terminal/init, /terminal/restart, /terminal/shutdown | MT5 terminal lifecycle |
| Account | /account | Live balance, equity, margin |
| Symbols | /symbols, /symbols/{symbol}, /tick, /ticks, /rates | Symbol specs and market data |
| Positions | /positions, /positions/{ticket} | Open position management |
| Orders | /orders, /orders/{ticket} | Order placement and management |
| History | /history/deals, /history/orders | Closed deals and orders |
Response format
All endpoints return JSON. HTTP helpers intrading/bot.py parse responses into SimpleNamespace objects:
Error handling
Non-2xx responses include aretcode field with the MT5 error code. The bot logs errors and sends a Telegram alert automatically.
| Code | Meaning |
|---|---|
| 10009 | Success |
| 10014 | Invalid stops (SL/TP too close to price) |
| 10018 | Market is closed |
| 10019 | Insufficient funds |
| 10024 | Too many requests |
Spread conversion
GET /symbols/{symbol}/rates returns spread in raw points. For BTCUSD:
trading.py handles this automatically.
Order types
POST /orders accepts the following type values:
BUY and SELL market orders. The other types are available for manual use.