Skip to content

Latest commit

Β 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Pocket Option 24/7 OTC REST API, WebSocket Streamer & AI Signal Engine

πŸš€ High-throughput Pocket Option Python Async REST API & WebSocket wrapper. 24/7 OTC live prices, closed M1 candle history & auto-trading bridge.

Official Telegram Channel Direct Contact AI Signals Bot Demo Account Verify Bot FastAPI Swagger Docs Python Version Docker Support License


πŸ“‘ Table of Contents

  1. 🌟 System Overview & Highlights
  2. πŸš€ Live API Interactive Swagger Documentation
  3. πŸ€– Official Telegram Bots & Live Demos
  4. πŸ—οΈ Architectural Design & Protocol Mechanics
  5. πŸ“¦ Complete Project Directory Structure
  6. ⚑ Fast Installation & 1-Click Deployment
  7. βš™οΈ Configuration Parameters (.env & JSON)
  8. πŸ’» Code Examples & Integration Snippets
  9. πŸ“‘ Available REST Endpoints & WebSocket Feeds
  10. 🎯 Signal Engine, Indicators & Winrate Filter
  11. πŸ›‘οΈ Self-Healing, Cloudflare Bypass & Anti-Ban Architecture
  12. πŸ›’ Commercial Source Code Purchase & Licensing
  13. πŸ’¬ Direct Contact & Community

🌟 System Overview & Highlights

Pocket Option 24/7 OTC REST API, WebSocket Streamer & AI Signal Engine is a state-of-the-art, enterprise-grade Python FastAPI REST and WebSocket protocol wrapper engineered specifically for Pocket Option. Built for algorithmic traders, prop trading firms, signal providers, and quantitative developers requiring 24/7 ultra-low latency execution and non-repainting market data streams.

  • πŸ•’ 24/7 OTC Market Coverage: Uninterrupted weekend and night feeds.
  • πŸ“Š Rolling 8-Day History: Non-repainting closed candle storage.
  • 🎯 TradingView Integration: Direct Pine Script webhook execution.

πŸš€ Live API Interactive Swagger Documentation

Experience the live production API server, test interactive Swagger requests, and inspect real-time schemas directly in your browser:
πŸ‘‰ https://api1.api.cbtraderbd.xyz/docs


πŸ€– Official Telegram Bots & Live Demos

You can immediately test our algorithms and automated account systems on Telegram:


πŸ—οΈ Architectural Design & Protocol Mechanics

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   CB TRADERS BD GATEWAY                β”‚
β”‚       https://api1.api.cbtraderbd.xyz/docs             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚                          β”‚
       REST API Requests          WebSocket Stream (WSS)
               β”‚                          β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  FastAPI Async Web Server   β”‚   β”‚  High-Speed WebSocket Pool   β”‚
β”‚  - Endpoint Validation      β”‚   β”‚  - Binary Frame Parsing      β”‚
β”‚  - JSON Schema Serializer   β”‚   β”‚  - Heartbeat Keep-Alive      β”‚
β”‚  - Token Authentication     β”‚   β”‚  - Auto-Reconnect Daemon     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚                          β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Core Engine Layer                     β”‚
β”‚  - Session Manager & Cloudflare Clearance Handler      β”‚
β”‚  - Non-Repaint M1/M5 Historical Candle Persistence     β”‚
β”‚  - AI Multi-Indicator Signal Strategy Pipeline         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚    Pocket Option Live Platform    β”‚
               β”‚   (Real Markets & 24/7 OTC)   β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Complete Project Directory Structure

This repository features an expansive, clean, and production-ready modular architecture:

β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ default.json             # Server host, port & connection pool configuration
β”‚   └── strategies.json          # Technical indicators, RSI thresholds & Martingale setups
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ API_REFERENCE.md         # Exhaustive endpoint reference and request/response payloads
β”‚   └── DEPLOYMENT_GUIDE.md      # Step-by-step VPS Linux (Ubuntu/Debian) & Docker setup
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ 01_quickstart.py         # 1-Click connection and live price check
β”‚   β”œβ”€β”€ 02_stream_candles.py     # Real-time WebSocket tick and candlestick listener
β”‚   β”œβ”€β”€ 03_auto_trade_signals.py # Automated execution based on AI indicator signals
β”‚   β”œβ”€β”€ 04_telegram_alerts.py    # Formatting and broadcasting signals to Telegram channels
β”‚   └── 05_historical_export.py  # Exporting multi-day M1/M5 datasets to CSV and SQLite
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ auth.py              # Cloudflare session token & cookie rotation manager
β”‚   β”‚   β”œβ”€β”€ client.py            # High-throughput asynchronous HTTP/REST client
β”‚   β”‚   β”œβ”€β”€ engine.py            # Master order processing & market event pipeline
β”‚   β”‚   └── websocket.py         # Resilient WebSocket protocol frame parser
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ candle.py            # Pydantic OHLCV candle validation schemas
β”‚   β”‚   β”œβ”€β”€ order.py             # Binary options trade order payload models
β”‚   β”‚   └── payout.py            # Live asset payout percentage schema
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ database.py          # SQLite/PostgreSQL persistence for 8-day rolling candles
β”‚   β”‚   └── telegram_bot.py      # Async Telegram broadcast & notification engine
β”‚   β”œβ”€β”€ strategies/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ martingale.py        # Dynamic stake sizing & risk mitigation calculator
β”‚   β”‚   β”œβ”€β”€ price_action.py      # Support/Resistance, Pinbar & Engulfing pattern scanner
β”‚   β”‚   └── rsi_bb.py            # RSI (14) + Bollinger Bands (20, 2) breakout analyzer
β”‚   └── utils/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ helpers.py           # Timezone converters, timestamp formatters & math tools
β”‚       └── logger.py            # Colored asynchronous console & file logger
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ install.sh               # Automated Linux dependency installer
β”‚   └── start_api.bat            # 1-Click Windows production launcher
β”œβ”€β”€ .env.example                 # Environment variables template
β”œβ”€β”€ .gitignore                   # Standard Python git exclusions
β”œβ”€β”€ Dockerfile                   # Multi-stage optimized Docker build
β”œβ”€β”€ docker-compose.yml           # Complete containerized service stack
β”œβ”€β”€ requirements.txt             # Locked production dependencies
└── README.md                    # In-depth system documentation

⚑ Fast Installation & 1-Click Deployment

Option A: Local Python Environment

# 1. Clone the repository
git clone https://github.com/cbtradersbd/pocket-option-api.git
cd pocket-option-api

# 2. Create and activate virtual environment
python -m venv venv
# On Windows:
venv\Scripts\activate
# On Linux/macOS:
source venv/bin/activate

# 3. Install required production dependencies
pip install -r requirements.txt

# 4. Configure your environment
cp .env.example .env

# 5. Launch the FastAPI server
python -m uvicorn src.core.engine:app --host 0.0.0.0 --port 8000 --reload

Option B: Docker Containerization

docker-compose up -d --build

βš™οΈ Configuration Parameters (.env & JSON)

# .env Configuration File
API_BASE_URL=https://api1.api.cbtraderbd.xyz
API_KEY=cb_traders_bd_license_unlocked
BROKER=pocket option
DEFAULT_TIMEFRAME=1m
RETENTION_DAYS=8
TIMEZONE_OFFSET=UTC+6
LOG_LEVEL=INFO
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=@your_channel

πŸ’» Code Examples & Integration Snippets

1. Fetch Live Price & Continuous 24/7 OTC Feed

from src.core.client import BrokerApiClient
from src.utils.logger import logger

client = BrokerApiClient(base_url="https://api1.api.cbtraderbd.xyz/docs")
price_data = client.get_live_price("EURUSD_otc")
logger.info(f"Live Tick: {price_data}")

2. Stream Real-Time Candlesticks via WebSocket

import asyncio
from src.core.websocket import ResilientWebSocketClient
from src.utils.logger import logger

async def on_candle(candle):
    logger.info(f"Closed M1 Candle: Time={candle.time}, Open={candle.open}, High={candle.high}, Low={candle.low}, Close={candle.close}")

async def main():
    ws = ResilientWebSocketClient(pair="EURUSD_otc")
    await ws.connect_and_listen(callback=on_candle)

if __name__ == "__main__":
    asyncio.run(main())

πŸ“‘ Available REST Endpoints & WebSocket Feeds

Endpoint Method Purpose Response Format
/docs GET Interactive Swagger API Explorer HTML / UI
/api/pocketoption/live-price GET Current bid/ask and tick stream JSON
/api/pocketoption/candles GET Historical closed OHLCV candle records JSON Array
/api/pocketoption/payouts GET Live payout percentage monitor for all pairs JSON Object
/api/pocketoption/signals POST Execute automated strategy webhook trigger JSON Result
/ws/pocketoption/stream WSS Ultra-low latency binary WebSocket feed Binary / JSON

🎯 Signal Engine, Indicators & Winrate Filter

  • Non-Repainting Guarantee: Signals are calculated strictly on closed candles ($T-1$). Running ticks are never used for candle finalization.
  • Triple Confirmation Filter:
    1. RSI Divergence: 14-period Relative Strength Index overbought ($>70$) and oversold ($<30$) boundary detection.
    2. Bollinger Band Squeeze: 20-period moving average with 2.0 standard deviation breakout validation.
    3. Trend Matrix: Exponential Moving Average (EMA 50 / EMA 200) trend directional filter.
  • Integrated Martingale Calculator: Auto-calculates step 1 & step 2 recovery stakes based on live asset payout rates.

πŸ›‘οΈ Self-Healing, Cloudflare Bypass & Anti-Ban Architecture

  • Zero-Drop Resilience: Automatically reconnects upon network interruptions with exponential backoff.
  • Token Clearance Handler: Bypasses Cloudflare Turnstile and session expirations seamlessly in the background.
  • Downtime Gap Recovery: Detects offline intervals and automatically queries past candles to backfill missing database records.

πŸ›’ Commercial Source Code Purchase & Licensing

Looking for the 100% full, unlocked source code with complete ownership, personal API keys, or custom bot development?

Full Commercial Package Includes:

  • πŸ“¦ 100% Full Unlocked Source Code (app.py, WebSocket protocols, database engine, AI signal bots).
  • πŸš€ 1-Click Automated Launchers for Windows, Linux VPS, and Docker.
  • ⚑ Unlimited Deployments on unlimited servers with zero restrictions.
  • πŸ› οΈ 24/7 1-on-1 Developer Setup Assistance & Support.
  • πŸ”„ Lifetime Code Updates & Strategy Enhancements.

πŸ’³ Accepted Payment Methods:

  • USDT (TRC20 / BEP20)
  • Binance Pay (UID / Pay ID)
  • Bitcoin / Ethereum / Crypto
  • Local Mobile Banking & Wire Transfers

πŸ’¬ Direct Contact & Community

About

πŸš€ High-throughput Pocket Option Python Async REST API & WebSocket wrapper. 24/7 OTC live prices, closed M1 candle history & auto-trading bridge.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages