Single-Asset Bot

🤖 RussBot is a free, open-source binary options trading bot for PocketOption, built on BinaryOptionsToolsV2Get it on GitLab
💬 Need help? Join the Chipa Discord · ⚡ Go no-code with ChipaEditor

trading_bot.py is the original RussBot: one asset, 15-second candles, 15-second expiry, verbose analysis output for every candle. It’s the best mode for learning how the strategy behaves.

Running It

python trading_bot.py

You’ll be prompted for:

Please enter your SSID: <your PocketOption session ID>
Enter asset (default: EURUSD_otc):
Enter trade amount (default: 1.0):

What Happens at Startup

  1. Connect — creates a PocketOptionAsync(ssid) client and waits 5 seconds for the connection
  2. Balance check — fetches and prints your account balance
  3. Historical pre-load — calls api.history(asset, 3600) to fetch the last hour of candles, validates each one, and fills the indicator buffers
  4. Readiness check — if ≥ 26 candles loaded, indicators are computed immediately and the bot prints 🟢 Ready for live trading!; otherwise it waits for live candles to accumulate
📈 Loading historical data for EURUSD_otc...
📊 Received 240 historical candles
✅ Loaded 240 valid candles into memory
🔧 Initial indicators calculated:
   EMA(10): 1.08447
   CCI(7): 42.10
   MACD: 0.00008
🟢 Ready for live trading!

The Live Loop

The bot subscribes to 15-second timed candles and analyzes each one:

stream = await self.api.subscribe_symbol_timed(
    self.asset,
    timedelta(seconds=15)
)

async for candle in stream:
    await self.analyze_and_trade(candle)

For every candle, analyze_and_trade():

  1. Validates and stores the candle (open/high/low/close are sanity-checked; the true high/low are recomputed from all four prices in case the feed mislabels them)
  2. Recalculates indicators — EMA(10), CCI(7), MACD(12, 26, 9) over the last 100 candles
  3. Prints the market state — price, EMA, CCI, MACD values
  4. Checks buy then sell conditions (see Strategy) and prints the result of every individual check:
Buy Check - Green: True, Above EMA: True, CCI~100: False (CCI: 63.20), EMA Up: True
No trading signals detected
  1. Executes a trade if a signal fired and the 16-second cooldown has elapsed
  2. Saves the current EMA/CCI as “previous” values for the next candle’s trend checks

Trade Execution & Result Tracking

Trades are placed with check_win=False so the event loop is never blocked, and a background task reports the outcome after expiry:

(trade_id, trade_data) = await self.api.buy(
    asset=self.asset,
    amount=self.amount,
    time=15,
    check_win=False
)

# Result checked in the background 17s later (15s expiry + 2s buffer)
asyncio.create_task(self.check_trade_result(trade_id, "BUY"))

Results appear as:

🎉 BUY Trade a1b2c3 WON!
😞 SELL Trade d4e5f6 LOST

Data Management

  • The bot keeps a rolling window of the last 100 candles (max_history) in collections.deque buffers — memory usage stays constant no matter how long it runs.
  • Candles with non-positive prices are discarded.
  • If historical loading fails, the bot degrades gracefully: it starts with live data only and begins trading once 26 live candles have accumulated (~6.5 minutes on 15-second candles).

When to Use Single-Asset Mode

Use single-asset when…Use multi-asset when…
You’re learning how the strategy behavesYou’ve validated the strategy and want more signal opportunities
You want verbose per-candle analysis outputYou want compact per-process logging
You’re testing config changesYou’re running “production” on a VPS
You only care about one specific assetYou want the >90% payout filter to pick assets for you

💬 Questions about the bot’s behavior on a specific asset? Ask in the Chipa Discord — and if you want to remix this strategy without editing Python, try ChipaEditor.