Enterprise-grade, 24/7 self-healing REST API & WebSocket wrapper for Olymp Trade (Forex, Crypto, Composite Indices, Stocks, and 24/7 OTC pairs).
Designed to stream real-time price feeds, record 8-day M1 candle histories, execute FTT orders, and power automated binary options trading bots and signal generators.
Looking for the full, production-ready source code with complete rights and 1-on-1 developer support?
- 📦 100% Full Unlocked Source Code (
app.py,worker.py,database.py,pyolymptrade/engine). - 🚀 1-Click Automated Windows Launcher (
start_api.bat). - ⚡ Unlimited Personal & Commercial License (Deploy on unlimited VPS/servers).
- 🛠️ 24/7 Developer Support & Setup Assistance.
- 🔄 Lifetime Code Updates & Bug Fixes.
📩 Contact on Telegram to Buy: @usmanch069
💳 Accepted Payment Methods: USDT (TRC20), Binance Pay, Crypto.
- 📈 Configurable M1 Candle History: Automatically maintains a rolling historical database of closed M1 candles (configurable in
.envviaRETENTION_DAYS=8) for all active Olymp Trade assets. - 🚫 Anti-Repaint Guarantee: Only finalized, official broker candles are persisted to the database. Running bars are never locked in prematurely.
- 🔄 Automatic Symbol Resolution: Intelligently normalizes input pairs and aliases (
EURUSD-OTC,EURUSD_otc->EURUSD_OTC,Asia Composite Index->ASIA_X,Europe Composite Index->EUROPE_X). - ⚡ Live On-Demand Broker Sync: If a requested asset has no candles cached locally, the API queries the broker live on-demand, caches them into
olymptrade.db, and returns them immediately. - 📊 Multi-Timeframe Downsampling: Query candles in
1m(default),5m,15m,30m, or1hintervals using high-performance OHLC downsampling. - 💰 Historical Payout Rate Tracking: Every M1 candle entry stores the exact real-time payout percentage recorded at that specific minute.
- 🕒 Fully Configurable Timezone Support: All API JSON outputs format timestamps as
YYYY-MM-DD HH:MM:SSwith fully customizable timezone offsets (e.g. UTC, UTC+6, EST, IST, GMT, etc.) alongside integer unixtimestamp. - 🛡️ Bulletproof Self-Healing Architecture:
- Automatically reconnects during network drops or socket disconnections.
- Automatically clears expired session tokens and re-authenticates via Chrome-impersonated REST login (
curl_cffi). - Automatically detects offline downtime gaps and backfills missing candles in the background.
- 📊 Real-Time ASCII Terminal UI: Beautiful live console dashboard featuring colored status indicators, account balance, asset sync counters, and visual progress bars.
- 🌐 Interactive Glassmorphic Web Portal: Includes a modern dark-mode web portal at
http://127.0.0.1:8000/for visual testing and interactive API querying.
olymptrade/
├── pyolymptrade/ # Production Asynchronous Olymp Trade WebSocket & REST API Engine
│ ├── _api/ # Mixins: account, trading, realtime, history
│ ├── utils/ # Candle downsampler & async slot registry
│ ├── client.py # Unified OlympTrade client orchestrator
│ └── config.py # Dual-tier session management
├── src/
│ ├── app.py # FastAPI REST Server, Interactive Web Portal & Webhooks
│ ├── worker.py # Background Ingestion Daemon & Live Streamer
│ ├── database.py # SQLite Persistence & Retention Daemon
│ └── delete_asset.py# Database Candle Purge CLI Utility
├── olymptrade.db # Root SQLite Database (Candles & Payouts)
├── start_api.bat # 1-Click Windows Production Launcher
├── requirements.txt # Python Dependencies
├── .env # Environment & Credentials Configuration
├── BUYER_GUIDE.txt # Setup Guide for Customers
└── README.md # System Documentation
- Python 3.10+ (Ensure
Add Python to PATHis enabled). - Windows or Linux OS (VPS / Desktop / Laptop).
Configure your Olymp Trade login details in .env:
OLYMPTRADE_EMAIL=your_email@gmail.com
OLYMPTRADE_PASSWORD=your_password
timezone=UTC
RETENTION_DAYS=8Double-click start_api.bat (or run python -m uvicorn src.app:app --host 127.0.0.1 --port 8000).
- Full Request URL:
http://127.0.0.1:8000/ - Description: Open in any web browser for interactive API querying, live database metrics, and sandbox testing.
Returns all active/inactive Olymp Trade assets, categories, trading modes (ftt, inzone), and live payout rates.
- Endpoint:
/api/v1/markets - Example Request:
GET http://127.0.0.1:8000/api/v1/markets - Response Format:
{
"timezone": "UTC",
"total_assets": 65,
"data": [
{
"symbol": "EURUSD_OTC",
"display_name": "EUR/USD OTC",
"category": "forex",
"modes": ["ftt", "inzone"],
"payout_percent": 85.0,
"is_active": true
},
{
"symbol": "ASIA_X",
"display_name": "Asia Composite Index",
"category": "composite",
"modes": ["ftt", "inzone"],
"payout_percent": 85.0,
"is_active": true
}
]
}Retrieves historical candle records for a symbol in chronological order (oldest first). Automatically fetches from broker on-demand if cache is cold.
- Endpoint:
/api/v1/candles - Example Request:
GET http://127.0.0.1:8000/api/v1/candles?symbol=EURUSD_OTC&limit=1000&timeframe=1m&timezone=UTC - Query Parameters:
symbol(string, required): Asset symbol (e.g.EURUSD_OTC,EURUSD-OTC,ASIA_X,Asia Composite Index).limit(integer, optional): Maximum candles to retrieve (default:1000, max:11520).timeframe(string, optional): Timeframe period (1m,5m,15m,30m,1h). Default:1m.timezone(string, optional): Target timezone offset (e.g.UTC,UTC+6,EST,IST,+5.5). Defaults to.envsetting.
- Response Format:
{
"symbol": "EURUSD_OTC",
"original_query": "EURUSD_OTC",
"timeframe": "1m",
"timezone": "UTC",
"candle_count": 2,
"candles": [
{
"timestamp": 1789307760,
"time": "2026-09-13 13:56:00",
"open": 1.13142,
"high": 1.13143,
"low": 1.13135,
"close": 1.13138,
"volume": 0.0,
"payout": 85.0
},
{
"timestamp": 1789307820,
"time": "2026-09-13 13:57:00",
"open": 1.13138,
"high": 1.13144,
"low": 1.13135,
"close": 1.13141,
"volume": 0.0,
"payout": 85.0
}
]
}Places an order directly from a URL or GET request. Ideal for browser bookmarks, webhooks, and 1-click execution.
- Endpoint:
/api/v1/trade - Example Request:
GET http://127.0.0.1:8000/api/v1/trade?symbol=EURUSD_OTC&action=up&amount=1&duration=60&account_type=DEMO - Parameters:
symbol(string, required): Asset name (e.g.EURUSD_OTC,ASIA_X).action(string, required):up/callordown/put.amount(float, optional): Stake amount in $ (default:1.0).duration(integer, optional): Expiry duration in seconds (default:60).account_type(string, optional):DEMOorREAL(default:DEMO).
Places a trade using a JSON payload. Ideal for Python trading bots, cURL, and external automated systems.
- Endpoint:
/api/v1/trade - Method:
POST - Payload Example:
{
"symbol": "EURUSD_OTC",
"action": "call",
"amount": 1.0,
"duration": 60,
"account_type": "DEMO"
}- Response Format:
{
"status": "success",
"symbol": "EURUSD_OTC",
"action": "UP",
"amount": 1.0,
"duration": 60,
"account_type": "DEMO",
"order_id": "deal-98127391",
"entry_price": 1.13138
}- List Active Orders:
GET /api/v1/deals - Check Trade Settlement:
GET /api/v1/trade/result?trade_id=deal-98127391
Universal webhook receiver for TradingView Pine Script alerts.
- Endpoint:
/webhook - Method:
POST - TradingView Alert Message:
{
"symbol": "{{ticker}}",
"action": "call",
"amount": 1.0,
"duration": 60,
"account_type": "DEMO"
}Includes an interactive CLI tool (src/delete_asset.py) allowing you to selectively inspect or delete candle history in olymptrade.db.
python src/delete_asset.py- Lists all asset pairs stored in
olymptrade.dbwith exact candle counts. - Enter a pair number or symbol name to purge candles for a single asset.
- Type
ALLto wipe the database and start fresh.
olymp trade api · olymp trade otc api · olymp trade python wrapper · olymp trade websocket bot · binary options api · olymp trade signal bot · fastapi olymp trade · olymp trade payouts api · olymp trade history candles · olymp trade auto trading · tradingview olymp trade webhook · binary options python bot · olymp trade ftt trading · composite index api · realtime quotes websocket · quotex pocket option olymp trade alternative
For sales inquiries, custom feature additions, or integration help, message directly on Telegram:
👉 @usmanch069
This software is provided for educational and personal use only. Trading financial instruments carries significant risk of loss. The authors are not responsible for any financial losses incurred through the use of this software. Always test on a demo account before using with live funds.