A high-performance, cross-platform package for automating binary options trading. Built with Rust for speed and memory safety, featuring Python bindings for ease of use.
This project is maintained by the ChipaDevTeam. Your support helps keep the updates coming.
| Support Channel | Link |
|---|---|
| PayPal | Support ChipaDevTeam |
| PocketOption (Six) | Join via Six's Affiliate Link |
| PocketOption (Chipa) | Join via Chipa's Affiliate Link |
BinaryOptionsTools v2 is a complete rewrite of the original library. It bridges the gap between low-level performance and high-level usability.
- Rust Core: Maximum performance, concurrency, and memory safety.
- Python Bindings: seamless integration with the Python ecosystem via PyO3.
- WebSocket Native: Real-time market data streaming and instant trade execution.
- Robust Connectivity: Automatic reconnection, keep-alive monitoring, and error handling.
- Type Safety: Strong typing across both Rust and Python interfaces.
- PocketOption (Quick Trading Mode & Pending Orders BETA)
- Real & Demo Accounts Supported
- Execution: Place Buy/Sell orders instantly.
- Monitoring: Check trade results (Win/Loss) with configurable timeouts.
- Balances: Real-time account balance retrieval.
- Portfolio: Access active positions and closed deal history.
- Live Stream: Subscribe to real-time candles (tick, 5s, 15s, 30s, 60s, 300s).
- Historical: Fetch OHLC data (
get_candles) for backtesting. - Payouts: Retrieve current payout percentages for assets.
- Sync: Server time synchronization for precision timing.
- Raw Handler API: Low-level WebSocket access for custom protocols.
- Validators: Built-in message filtering system.
- Asset Logic: Automatic verification of trading pairs and OTC availability.
The system uses a layered architecture to ensure stability and speed.
graph TD
User[User Application <br/> Python/Rust/JS] --> Bindings[Language Bindings <br/> PyO3 Async/Sync Wrappers]
Bindings --> Core[Rust Core Library]
subgraph Rust Core
Core --> WS[WebSocket Client <br/> Tungstenite]
Core --> Mgr[Connection Manager]
Core --> Router[Message Router & Validators]
end
WS <--> API[PocketOption WebSocket API]
Install directly from our GitHub releases. Ensure you have Python 3.8 - 3.12.
Windows
pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/releases/download/BinaryOptionsToolsV2-0.2.5/binaryoptionstoolsv2-0.2.5-cp38-abi3-win_amd64.whl"Linux
pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/releases/download/BinaryOptionsToolsV2-0.2.5/BinaryOptionsToolsV2-0.2.5-cp38-abi3-manylinux_2_34_x86_64.whl"macOS (Apple Silicon)
pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/releases/download/BinaryOptionsToolsV2-0.2.5/BinaryOptionsToolsV2-0.2.5-cp38-abi3-macosx_11_0_arm64.whl"Requires rustc, cargo, and maturin.
git clone https://github.com/ChipaDevTeam/BinaryOptionsTools-v2.git
cd BinaryOptionsTools-v2/BinaryOptionsToolsV2
pip install maturin
maturin develop --releasepip install git+https://github.com/ChipaDevTeam/BinaryOptionsTools-v2.git#subdirectory=BinaryOptionsToolsV2Add this to your Cargo.toml:
[dependencies]
binary_options_tools = { path = "crates/binary_options_tools" }Best for building trading bots that need to handle streams and trades simultaneously.
import asyncio
import os
from BinaryOptionsToolsV2 import PocketOptionAsync
async def main():
# 1. Get SSID (Session ID)
ssid = os.getenv("POCKET_OPTION_SSID")
# 2. Initialize with Context Manager
async with PocketOptionAsync(ssid=ssid) as client:
# Get Balance
balance = await client.balance()
print(f"Current Balance: ${balance}")
# Place Trade: Asset, Amount, Duration
trade_id, deal = await client.buy("EURUSD_otc", 1.0, 60)
print(f"Trade Placed: {deal}")
# Wait for Result
result = await client.check_win(trade_id)
print(f"Outcome: {result['result']}")
if __name__ == "__main__":
asyncio.run(main())Best for simple scripts or data fetching.
from BinaryOptionsToolsV2 import PocketOption
import os
with PocketOption(ssid=os.getenv("POCKET_OPTION_SSID")) as client:
print(f"Balance: ${client.balance()}")
trade_id, _ = client.buy("EURUSD_otc", 1.0, 60)
print(f"Result: {client.check_win(trade_id)['result']}")async with PocketOptionAsync(ssid="...") as client:
# Subscribe to 1-minute candles
subscription = await client.subscribe_symbol("EURUSD_otc", 60)
print("Streaming data...")
async for candle in subscription:
print(f"Timestamp: {candle['time']} | Close: {candle['close']}")For complex implementations, you can access the Raw Handler API. This allows you to construct custom WebSocket messages and filter responses.
# Create a validator to filter messages containing "balance"
validator = Validator.contains("balance")
handler = await client.create_raw_handler(validator)
# Send raw JSON request
await handler.send_text('42["getBalance"]')
# Listen to the filtered stream
async for message in await handler.subscribe():
print(f"Raw Update: {message}")Note on Authentication: Authentication is handled via the
SSIDcookie. See our Tutorials Directory for instructions on how to extract this from your browser.
- PocketOption: Quick Trading
- PocketOption: Pending Orders (BETA)
- Platform: Expert Options Integration
- Platform: IQ Option Integration
- Core: JavaScript/TypeScript Bindings
- Core: WebAssembly (WASM) Support
- Tools: Historical Data Export & Backtesting Framework
We welcome contributions!
- Fork the repo.
- Ensure tests pass (
cargo test&pytest). - Submit a Pull Request with clear descriptions.
- Personal Use: Free for personal, educational, and non-commercial use.
- Commercial Use: Requires explicit written permission. Contact us on Discord.
- See LICENSE for details.
This software is provided "AS IS" without warranty of any kind.
- Binary options trading involves high risk and may result in the loss of capital.
- The authors and ChipaDevTeam are NOT responsible for any financial losses, trading errors, or software bugs.
- Use this software entirely at your own risk.