Skip to content

ChipaDevTeam/BinaryOptionsTools-v2

Β 
Β 

Repository files navigation

BinaryOptionsTools V2

Discord Crates.io Python

A powerful, multi-language library for automated binary options trading. Built with Rust for performance and safety, with bindings for Python, JavaScript, C#, Go, Kotlin, Ruby, and Swift.

πŸš€ Features

Currently we support PocketOption (quick trading) with the following features (for real and demo accounts):

  • βœ… Trading Operations: Place buy/sell trades for any asset
  • βœ… Trade Management: Check trade results with optional timeout
  • βœ… Account Information: Get account balance and server time synchronization
  • βœ… Asset Data: Get payout information for each asset
  • βœ… Real-time Data: Subscribe to assets for real-time price data with different subscription types
  • βœ… Trade Monitoring: Get list of opened trades with all trade data
  • βœ… Asset Validation: Validate assets and retrieve detailed information
  • βœ… Connection Management: Automatic reconnection and connection status monitoring

πŸ“‹ TODO Features

  • ⏳ Historical candle data retrieval
  • ⏳ Closed trades management and history
  • ⏳ Pending trades support
  • ⏳ Additional trading platforms (Expert Options, etc.)

πŸ’¬ Support & Community

If you are looking to build a bot, let us build it for you! Check Chipa's shop

Support us and our contributors:

Don't know programming and you are looking for a bot to automate YOUR strategy? Get our development services!

Features

Currently we only support Pocket Option (quick trading) with the following features (for real and demo):

  • Place trades for any asset (buy/sell)
  • Check trade results with optional timeout
  • Get account balance
  • Get server time synchronization
  • Get the payout of each asset
  • Get a list with the opened trades with all of the trades data
  • Subscribe to an asset to get realtime data with different subscription types
  • Asset validation and information retrieval
  • Automatic reconnection and connection management

TODO Features

  • Get a list with the closed trades with all of the trades data
  • Get candle data for a specific asset (historical data)
  • Add support for pending trades
  • Add support for other trading platforms like Expert Options

🌍 Supported Languages

We provide bindings for multiple programming languages:

  • Python - Full sync and async support (Python 3.8+)
  • Rust - Native async implementation
  • JavaScript/Node.js - Async support via UniFFI bindings
  • C# - .NET support via UniFFI bindings
  • Go - Go support via UniFFI bindings
  • Kotlin - JVM support via UniFFI bindings
  • Ruby - Ruby support via UniFFI bindings
  • Swift - iOS/macOS support via UniFFI bindings

πŸ“¦ Quick Start

Python

Installation:

# Windows
pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/blob/master/wheels/BinaryOptionsToolsV2-0.1.8-cp38-abi3-win_amd64.whl?raw=true"

# Linux
pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/blob/master/wheels/BinaryOptionsToolsV2-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl?raw=true"

Quick Example (Synchronous):

from BinaryOptionsToolsV2.pocketoption import PocketOption
import time

# Initialize client
client = PocketOption(ssid="your-session-id")
time.sleep(5)  # Wait for connection to establish

# Get balance
balance = client.balance()
print(f"Account Balance: ${balance}")

# Place a buy trade
trade_id, deal = client.buy("EURUSD_otc", 60, 1.0)
print(f"Trade placed: {deal}")

# Check result
result = client.check_win(trade_id)
print(f"Trade result: {result}")

Quick Example (Asynchronous):

from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync
import asyncio

async def main():
    # Initialize client
    client = PocketOptionAsync(ssid="your-session-id")
    await asyncio.sleep(5)  # Wait for connection to establish
    
    # Get balance
    balance = await client.balance()
    print(f"Account Balance: ${balance}")
    
    # Place a buy trade
    trade_id, deal = await client.buy("EURUSD_otc", 60, 1.0)
    print(f"Trade placed: {deal}")
    
    # Check result
    result = await client.check_win(trade_id)
    print(f"Trade result: {result}")

asyncio.run(main())

Rust

Installation:

Add to your Cargo.toml:

[dependencies]
binary_options_tools = "0.1"
tokio = { version = "1", features = ["full"] }

Quick Example:

use binary_options_tools::PocketOption;
use std::time::Duration;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Initialize client
    let client = PocketOption::new("your-session-id").await?;
    
    // Wait for connection to establish
    tokio::time::sleep(Duration::from_secs(5)).await;
    
    // Get balance
    let balance = client.balance().await;
    println!("Account Balance: ${}", balance);
    
    // Place a buy trade
    let (trade_id, deal) = client.buy("EURUSD_otc", 60, 1.0).await?;
    println!("Trade placed: {:?}", deal);
    
    // Check result
    let result = client.result(trade_id).await?;
    println!("Trade result: {:?}", result);
    
    Ok(())
}

πŸ“š Documentation

πŸ’‘ Examples

You can find comprehensive examples for all features in the examples directory:

πŸ”§ Building from Source

Prerequisites:

  • Rust and Cargo installed (Install Rust)
  • Python 3.8+ (for Python bindings)
  • Maturin (for building Python wheels)

Build Python Wheel:

cd BinaryOptionsToolsV2
maturin build -r

Build Rust Crate:

cargo build --release

🀝 Contributing

We welcome contributions! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the terms specified in the LICENSE file.

⚠️ Disclaimer

This software is for educational purposes only. Trading binary options involves substantial risk of loss and is not suitable for all investors. Use at your own risk.