Skip to main content

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.
curl -H "Authorization: Bearer <API_TOKEN>" https://terminal-one.novosky.app/ping
Set 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:
GroupEndpointsDescription
System/ping, /ping/broker, /errorHealth, broker latency, last error
Terminal/terminal, /terminal/init, /terminal/restart, /terminal/shutdownMT5 terminal lifecycle
Account/accountLive balance, equity, margin
Symbols/symbols, /symbols/{symbol}, /tick, /ticks, /ratesSymbol specs and market data
Positions/positions, /positions/{ticket}Open position management
Orders/orders, /orders/{ticket}Order placement and management
History/history/deals, /history/ordersClosed deals and orders

Response format

All endpoints return JSON. HTTP helpers in trading/bot.py parse responses into SimpleNamespace objects:
account = api_get("/account")
print(account.balance, account.equity)

tick = api_get("/symbols/BTCUSD/tick")
print(tick.bid, tick.ask)

Error handling

Non-2xx responses include a retcode field with the MT5 error code. The bot logs errors and sends a Telegram alert automatically.
{ "retcode": 10014, "message": "Invalid stops" }
Common retcodes:
CodeMeaning
10009Success
10014Invalid stops (SL/TP too close to price)
10018Market is closed
10019Insufficient funds
10024Too many requests

Spread conversion

GET /symbols/{symbol}/rates returns spread in raw points. For BTCUSD:
1695 pts × $0.01 = $16.95 round-turn spread
trading.py handles this automatically.

Order types

POST /orders accepts the following type values:
BUY, SELL
BUY_LIMIT, SELL_LIMIT
BUY_STOP, SELL_STOP
BUY_STOP_LIMIT, SELL_STOP_LIMIT
The NOVOSKY bot only places BUY and SELL market orders. The other types are available for manual use.