Brent Oil Trading Bot — Telegram bot for Pocket Option
Stack: Python, aiogram, scikit-learn, XGBoost, LightGBM, PyTorch, curl_cffi, Pillow
What does it do?:
- The Telegram bot analyzes the Brent Oil market in real-time and automatically places bets on Pocket Option. The foundation is an ML model trained on 10,000+ candles of OTC quote history.
Architecture
- Data collection: WebSocket client with Chrome TLS emulation (curl_cffi) reads quotes from Pocket Option in real-time — ticks, candles, balance, trade results.
- ML core: Random Forest + XGBoost + LightGBM, 26 features (RSI, Stochastic, MACD, Bollinger, ADX, ATR, EMA, Alligator, PSAR, Supertrend, candlestick patterns, time of day, volatility). Walk-forward validation on 10k candles.
- Neural network: LSTM (PyTorch) on raw OHLCV sequences — tested, did not outperform tree models.
- Regime adaptation: quietly detects trend/sideways/volatility → switches strategy (trend-following / mean-reversion).
- Auto-trading: the bot places bets via PO WebSocket (openOrder, call/put). Auto-tracking win/loss through close events.
- Two modes: ML auto-betting (works without intervention) + regular signals with a "Place Bet" button (semi-automatic).
Key decisions:
- Reverse engineering of the closed WebSocket protocol of Pocket Option (Socket.IO v4, Engine.IO, Qrator bypass).
- 9 technical strategies + ML confluence + multi-timeframe trend filter.
- Exponential reconnect delay (from 1s — does not lose data, does not DDoS the server).
- Auto-update of the deposit from PO balance in real-time.
- Persistence of settings (state.json), one-click auto-betting toggle.
- Client account connection via /connect (cookies → auto-extract session/uid/server).
Interface
- Minimalist Telegram menu: Start / Stop / Auto-betting (ON/OFF) / Expiration / Deposit. Signal cards (green/red, generated on Pillow). Instructions for non-technical users (README).
#Python #TelegramBot #MachineLearning #Trading #WebSocket #AI #Automation #DataAnalysis #WebScraping #fintech
Stack: Python, aiogram, scikit-learn, XGBoost, LightGBM, PyTorch, curl_cffi, Pillow
What does it do?:
- The Telegram bot analyzes the Brent Oil market in real-time and automatically places bets on Pocket Option. The foundation is an ML model trained on 10,000+ candles of OTC quote history.
Architecture
- Data collection: WebSocket client with Chrome TLS emulation (curl_cffi) reads quotes from Pocket Option in real-time — ticks, candles, balance, trade results.
- ML core: Random Forest + XGBoost + LightGBM, 26 features (RSI, Stochastic, MACD, Bollinger, ADX, ATR, EMA, Alligator, PSAR, Supertrend, candlestick patterns, time of day, volatility). Walk-forward validation on 10k candles.
- Neural network: LSTM (PyTorch) on raw OHLCV sequences — tested, did not outperform tree models.
- Regime adaptation: quietly detects trend/sideways/volatility → switches strategy (trend-following / mean-reversion).
- Auto-trading: the bot places bets via PO WebSocket (openOrder, call/put). Auto-tracking win/loss through close events.
- Two modes: ML auto-betting (works without intervention) + regular signals with a "Place Bet" button (semi-automatic).
Key decisions:
- Reverse engineering of the closed WebSocket protocol of Pocket Option (Socket.IO v4, Engine.IO, Qrator bypass).
- 9 technical strategies + ML confluence + multi-timeframe trend filter.
- Exponential reconnect delay (from 1s — does not lose data, does not DDoS the server).
- Auto-update of the deposit from PO balance in real-time.
- Persistence of settings (state.json), one-click auto-betting toggle.
- Client account connection via /connect (cookies → auto-extract session/uid/server).
Interface
- Minimalist Telegram menu: Start / Stop / Auto-betting (ON/OFF) / Expiration / Deposit. Signal cards (green/red, generated on Pillow). Instructions for non-technical users (README).
#Python #TelegramBot #MachineLearning #Trading #WebSocket #AI #Automation #DataAnalysis #WebScraping #fintech