Try Live
Add Docs
Rankings
Pricing
Enterprise
Docs
Install
Theme
Install
Docs
Pricing
Enterprise
More...
More...
Try Live
Rankings
Create API Key
Add Docs
BinaryOptionsTools V2
https://github.com/chipadevteam/binaryoptionstools-v2
Admin
A high-performance, cross-platform package for automating binary options trading, built with Rust
...
Tokens:
106,845
Snippets:
825
Trust Score:
8.8
Update:
1 month ago
Context
Skills
Chat
Benchmark
85.5
Suggestions
Latest
Show doc for...
Code
Info
Show Results
Context Summary (auto-generated)
Raw
Copy
Link
# BinaryOptionsTools V2 BinaryOptionsTools V2 is a high-performance, cross-platform library for automating binary options trading on platforms like PocketOption. Built with Rust for maximum speed and memory safety, it provides seamless Python bindings via PyO3 for ease of use. The library offers both synchronous and asynchronous APIs, enabling developers to place trades, monitor results, stream real-time market data, and build automated trading bots with robust WebSocket connectivity and automatic reconnection logic. The core functionality centers around WebSocket-based communication with trading platforms, providing instant trade execution (buy/sell orders), real-time price streaming, historical candle data retrieval, account balance monitoring, and comprehensive deal management. The architecture includes a Bot Framework for event-driven strategy development, Raw Handler API for custom WebSocket protocols, and cross-platform UniFFI bindings supporting Kotlin, Swift, Go, C#, Ruby, and Python from a single Rust codebase. ## Installation Install from PyPI for Python 3.8+. ```bash # Windows pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/releases/download/v0.2.9/binaryoptionstoolsv2-0.2.9-cp39-abi3-win_amd64.whl" # Linux pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/releases/download/v0.2.9/binaryoptionstoolsv2-0.2.9-cp39-abi3-manylinux_2_28_x86_64.whl" # macOS pip install "https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/releases/download/v0.2.9/binaryoptionstoolsv2-0.2.9-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl" # Build from source (requires Rust + maturin) pip install git+https://github.com/ChipaDevTeam/BinaryOptionsTools-v2.git#subdirectory=BinaryOptionsToolsV2 ``` --- ## PocketOptionAsync - Async Client Initialization The primary async client for interacting with PocketOption. Supports context manager for automatic connection handling and cleanup. The SSID is your session ID obtained from the platform's browser cookies. ```python import asyncio import os from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync from BinaryOptionsToolsV2.config import Config async def main(): ssid = os.getenv("POCKET_OPTION_SSID") # Basic initialization with context manager (recommended) async with PocketOptionAsync(ssid=ssid) as client: balance = await client.balance() print(f"Account Balance: ${balance}") print(f"Is Demo Account: {client.is_demo()}") # Manual initialization with custom config config = Config( timeout_secs=30, reconnect_time=5, connection_initialization_timeout_secs=60, terminal_logging=True, log_level="INFO" ) client = PocketOptionAsync(ssid=ssid, config=config) await client.wait_for_assets(timeout=60.0) # Use client... await client.shutdown() asyncio.run(main()) ``` --- ## PocketOption - Sync Client Initialization Synchronous wrapper around the async client for simpler scripts that don't require asyncio. Automatically manages event loop internally. ```python from BinaryOptionsToolsV2.pocketoption import PocketOption def main(): ssid = "42[\"auth\",{\"session\":\"your-session-id\"}]" # Context manager handles connection and cleanup with PocketOption(ssid=ssid) as client: balance = client.balance() print(f"Account Balance: ${balance}") print(f"Is Demo Account: {client.is_demo()}") # Get server time for synchronization server_time = client.get_server_time() print(f"Server Time: {server_time}") if __name__ == "__main__": main() ``` --- ## buy() - Place Call Trade Places a buy (call) order predicting the asset price will go up. Returns the trade ID and deal details. Optionally waits for trade result with check_win parameter. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Place buy trade: asset, amount ($), expiry time (seconds) trade_id, deal = await client.buy( asset="EURUSD_otc", amount=1.0, time=60, check_win=False ) print(f"Trade ID: {trade_id}") print(f"Deal Data: {deal}") # Output: {'asset': 'EURUSD_otc', 'amount': 1.0, 'direction': 'call', ...} # Place trade and wait for result automatically trade_id, result = await client.buy( asset="EURUSD_otc", amount=1.0, time=60, check_win=True ) print(f"Result: {result['result']}") # 'win', 'loss', or 'draw' print(f"Profit: ${result.get('profit', 0)}") asyncio.run(main()) ``` --- ## sell() - Place Put Trade Places a sell (put) order predicting the asset price will go down. Same API as buy() but for opposite trade direction. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Place sell trade trade_id, deal = await client.sell( asset="EURUSD_otc", amount=1.0, time=60, check_win=False ) print(f"Sell Trade ID: {trade_id}") print(f"Deal: {deal}") # Sell with automatic result check trade_id, result = await client.sell( asset="GBPUSD_otc", amount=2.0, time=120, check_win=True ) print(f"Trade Result: {result['result']}") asyncio.run(main()) ``` --- ## check_win() - Check Trade Result Checks the outcome of a placed trade by its ID. Blocks until the trade expires and result is available. Returns result as 'win', 'loss', or 'draw'. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Place a short trade trade_id, _ = await client.buy(asset="EURUSD_otc", amount=1.0, time=15) print(f"Trade placed: {trade_id}") # Wait for and check result result = await client.check_win(trade_id) print(f"Result: {result['result']}") # 'win', 'loss', or 'draw' print(f"Profit: {result.get('profit', 0)}") print(f"Full data: {result}") # Output: {'id': '...', 'asset': 'EURUSD_otc', 'profit': 0.85, 'result': 'win', ...} asyncio.run(main()) ``` --- ## balance() - Get Account Balance Retrieves the current account balance. Updates in real-time as trades are completed. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: balance = await client.balance() print(f"Current Balance: ${balance}") # Check account type if client.is_demo(): print("Using DEMO account") else: print("Using REAL account - trade carefully!") asyncio.run(main()) ``` --- ## payout() - Get Asset Payouts Retrieves payout percentages for trading assets. Can query all assets, specific asset, or list of assets. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Get all asset payouts all_payouts = await client.payout() print(f"All payouts: {all_payouts}") # Output: {'EURUSD_otc': 85, 'GBPUSD_otc': 82, 'BTCUSD': 75, ...} # Get single asset payout eurusd_payout = await client.payout("EURUSD_otc") print(f"EURUSD_otc payout: {eurusd_payout}%") # Get multiple asset payouts payouts = await client.payout(["EURUSD_otc", "GBPUSD_otc", "BTCUSD"]) print(f"Selected payouts: {payouts}") # [85, 82, 75] asyncio.run(main()) ``` --- ## get_candles() - Fetch Historical Candles Retrieves historical OHLC (Open, High, Low, Close) candle data for technical analysis and backtesting. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Get candles: asset, period (seconds), offset (time range) candles = await client.get_candles("EURUSD_otc", 60, 3600) # 1-hour of 1-min candles print(f"Retrieved {len(candles)} candles") for candle in candles[-3:]: # Last 3 candles print(f"Time: {candle['time']}, Open: {candle['open']}, " f"High: {candle['high']}, Low: {candle['low']}, Close: {candle['close']}") # Available timeframes: 1, 5, 15, 30, 60, 300 seconds candles_5min = await client.candles("EURUSD_otc", 300) # 5-minute candles print(f"5-min candles: {len(candles_5min)}") asyncio.run(main()) ``` --- ## compile_candles() - Create Custom Timeframe Candles Compiles custom-period candlesticks from raw tick data, enabling non-standard timeframes like 20s, 40s, or 90s candles. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Compile 20-second candles from last 5 minutes of tick data custom_candles = await client.compile_candles( asset="EURUSD_otc", custom_period=20, # 20-second candles lookback_period=300 # Fetch 5 minutes of ticks ) print(f"Compiled {len(custom_candles)} custom 20s candles") for candle in custom_candles[-5:]: print(f"Time: {candle['time']}, O: {candle['open']:.5f}, C: {candle['close']:.5f}") asyncio.run(main()) ``` --- ## history() - Get Recent Price History Retrieves the latest available historical data for an asset. Similar to get_candles() but uses different API endpoint. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Fetch last minute of data history = await client.history("EURUSD_otc", 60) print(f"Retrieved {len(history)} candles") # Calculate simple moving average if history: closes = [c['close'] for c in history] sma = sum(closes) / len(closes) print(f"SMA: {sma:.5f}") print(f"Latest close: {history[-1]['close']:.5f}") asyncio.run(main()) ``` --- ## subscribe_symbol() - Real-Time Price Stream Creates a real-time data subscription for live price updates. Returns an async iterator yielding candle data. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Subscribe to real-time candles stream = await client.subscribe_symbol("EURUSD_otc") print("Streaming live prices (Ctrl+C to stop)...") count = 0 async for candle in stream: print(f"Time: {candle['time']}, Close: {candle['close']:.5f}") count += 1 if count >= 10: # Limit for demo break # Unsubscribe when done await client.unsubscribe("EURUSD_otc") asyncio.run(main()) ``` --- ## subscribe_symbol_timed() - Time-Interval Price Stream Creates a subscription that yields candle updates at regular time intervals, useful for building consistent timeframe candles. ```python import asyncio from datetime import timedelta from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Get candle updates every 5 seconds stream = await client.subscribe_symbol_timed("EURUSD_otc", timedelta(seconds=5)) print("Receiving 5-second candles...") count = 0 async for candle in stream: print(f"5s Candle - Open: {candle['open']:.5f}, Close: {candle['close']:.5f}") count += 1 if count >= 6: # 30 seconds of data break asyncio.run(main()) ``` --- ## subscribe_symbol_chuncked() - Chunked Price Stream Creates a subscription that aggregates raw price ticks into candles based on tick count rather than time. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Create candle from every 10 ticks stream = await client.subscribe_symbol_chuncked("EURUSD_otc", chunck_size=10) print("Receiving chunked candles (10 ticks each)...") count = 0 async for candle in stream: print(f"Chunk Candle: O={candle['open']:.5f}, H={candle['high']:.5f}, " f"L={candle['low']:.5f}, C={candle['close']:.5f}") count += 1 if count >= 5: break asyncio.run(main()) ``` --- ## opened_deals() / closed_deals() - Deal Management Retrieves lists of currently open trades and historical closed trades for portfolio management. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Get all open deals open_deals = await client.opened_deals() print(f"Open deals: {len(open_deals)}") for deal in open_deals: print(f" ID: {deal.get('id')}, Asset: {deal.get('asset')}, " f"Amount: ${deal.get('amount')}") # Get closed deals history closed = await client.closed_deals() print(f"\nClosed deals: {len(closed)}") # Calculate profit/loss total_pnl = sum(d.get('profit', 0) for d in closed) wins = sum(1 for d in closed if d.get('profit', 0) > 0) print(f"Total P/L: ${total_pnl:.2f}") print(f"Win rate: {wins}/{len(closed)} ({100*wins/len(closed):.1f}%)" if closed else "") # Clear closed deals from memory await client.clear_closed_deals() asyncio.run(main()) ``` --- ## open_pending_order() - Create Pending Order Opens a pending order that executes when price reaches specified level. Allows advanced order types beyond instant execution. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: server_time = await client.get_server_time() # Create pending order order = await client.open_pending_order( open_type=1, # Order type amount=1.0, # Trade amount asset="EURUSD_otc", # Asset symbol open_time=server_time + 60, # Execute after 60 seconds open_price=1.0850, # Target price timeframe=60, # Trade duration min_payout=80, # Minimum payout % command=0 # 0=Call, 1=Put ) print(f"Pending order created: {order}") # Get all pending orders pending = await client.get_pending_deals() print(f"Pending orders: {len(pending)}") asyncio.run(main()) ``` --- ## active_assets() - Get Available Assets Retrieves list of all currently active/tradeable assets with their details including payouts and trading status. ```python import asyncio from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: assets = await client.active_assets() print(f"Active assets: {len(assets)}") # Filter OTC assets (available 24/7) otc_assets = [a for a in assets if a.get('symbol', '').endswith('_otc')] print(f"OTC assets: {len(otc_assets)}") # Show top assets by payout sorted_assets = sorted(assets, key=lambda x: x.get('payout', 0), reverse=True) print("\nTop 5 by payout:") for asset in sorted_assets[:5]: print(f" {asset['symbol']}: {asset.get('payout', 'N/A')}%") asyncio.run(main()) ``` --- ## Validator - Message Filtering Validators filter WebSocket messages for raw handler operations. Support regex, prefix/suffix matching, and logical combinations. ```python from BinaryOptionsToolsV2.validator import Validator # Basic validators regex_v = Validator.regex(r'"type":"signal"') starts_v = Validator.starts_with('42["balance"') ends_v = Validator.ends_with('"}]') contains_v = Validator.contains('"status":"success"') # Test validators print(regex_v.check('{"type":"signal","data":{}}')) # True print(starts_v.check('42["balance",100]')) # True print(contains_v.check('{"status":"success"}')) # True # Logical combinations combined = Validator.all([ Validator.contains('"type":"trade"'), Validator.contains('"status":"completed"') ]) print(combined.check('{"type":"trade","status":"completed"}')) # True any_match = Validator.any([ Validator.contains("error"), Validator.contains("success") ]) print(any_match.check('{"result":"success"}')) # True # Negation not_error = Validator.ne(Validator.contains("error")) print(not_error.check('{"status":"ok"}')) # True # Custom function validator custom = Validator.custom(lambda x: x.startswith("42") and len(x) > 10) print(custom.check('42["event",{}]')) # True ``` --- ## create_raw_handler() - Advanced WebSocket Access Creates a raw handler for low-level WebSocket operations with custom message filtering. Enables custom protocol implementations. ```python import asyncio import json from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync from BinaryOptionsToolsV2.validator import Validator async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Create handler for balance-related messages validator = Validator.contains('"balance"') handler = await client.create_raw_handler(validator) print(f"Handler ID: {handler.id()}") # Send message and wait for matching response response = await handler.send_and_wait('42["getBalance"]') data = json.loads(response) print(f"Balance response: {data}") # Subscribe to stream of matching messages stream = await handler.subscribe() async for message in stream: print(f"Raw message: {message}") break # Just show one asyncio.run(main()) ``` --- ## create_raw_order() - Send Raw WebSocket Message Sends a raw WebSocket message and waits for a response matching the validator. Enables custom API interactions. ```python import asyncio import json from datetime import timedelta from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync from BinaryOptionsToolsV2.validator import Validator async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Basic raw order validator = Validator.contains('"status"') try: response = await client.create_raw_order('42["ping"]', validator) print(f"Response: {response}") except Exception as e: print(f"Error: {e}") # With custom timeout validator = Validator.regex(r'"data":\[') try: response = await client.create_raw_order_with_timeout( '42["signals/subscribe"]', validator, timeout=timedelta(seconds=10) ) print(f"Signals response: {response}") except TimeoutError: print("Request timed out") # With automatic retry validator = Validator.contains('"success"') response = await client.create_raw_order_with_timeout_and_retry( '42["subscribe"]', validator, timeout=timedelta(seconds=30) ) print(f"Reliable response: {response}") asyncio.run(main()) ``` --- ## create_raw_iterator() - Stream Raw Messages Creates an async iterator for streaming responses after sending an initial message. Useful for subscriptions. ```python import asyncio from datetime import timedelta from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync from BinaryOptionsToolsV2.validator import Validator async def main(): async with PocketOptionAsync(ssid="your-ssid") as client: # Create iterator for signal updates validator = Validator.starts_with('42["signal"') iterator = await client.create_raw_iterator( message='42["signals/subscribe"]', validator=validator, timeout=timedelta(minutes=5) ) print("Streaming signals...") count = 0 async for message in iterator: print(f"Signal: {message}") count += 1 if count >= 5: break asyncio.run(main()) ``` --- ## PyBot / PyStrategy - Bot Framework Event-driven framework for building automated trading bots. Implement PyStrategy to define trading logic with callbacks for candles, ticks, and deal events. ```python import asyncio import json import os from BinaryOptionsToolsV2 import PyBot, PyStrategy, RawPocketOption, start_tracing class SimpleStrategy(PyStrategy): def __init__(self): super().__init__() self.trade_count = 0 def on_start(self, ctx): print("Strategy started!") def on_candle(self, ctx, asset, candle_json): candle = json.loads(candle_json) print(f"[{asset}] Close: {candle['close']}") # Simple strategy: buy if price ends in 5 if str(candle['close']).endswith('5') and self.trade_count < 3: self.trade_count += 1 asyncio.create_task(self.execute_trade(ctx, asset)) async def execute_trade(self, ctx, asset): try: result = await ctx.buy(asset, 1.0, 60) print(f"Trade executed: {result}") except Exception as e: print(f"Trade failed: {e}") async def main(): start_tracing("info") ssid = os.getenv("POCKET_OPTION_SSID") client = await RawPocketOption.create(ssid) strategy = SimpleStrategy() bot = PyBot(client, strategy) # Add assets to monitor with candle period bot.add_asset("EURUSD_otc", 60) # 1-minute candles bot.add_asset("GBPUSD_otc", 60) print("Running bot...") await bot.run() asyncio.run(main()) ``` --- ## Config - Client Configuration Configure connection parameters, timeouts, and logging settings for the client. ```python from BinaryOptionsToolsV2.config import Config from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync # Create custom configuration config = Config( max_allowed_loops=100, # Max reconnection attempts sleep_interval=100, # Sleep between operations (ms) reconnect_time=5, # Reconnect delay (seconds) connection_initialization_timeout_secs=60, # Connection timeout timeout_secs=30, # General operation timeout urls=["wss://custom-server.com/ws"], # Custom WebSocket URLs terminal_logging=True, # Enable console logging log_level="DEBUG" # Log level ) # From dictionary config_dict = { "timeout_secs": 45, "terminal_logging": True, "log_level": "INFO" } config = Config.from_dict(config_dict) # From JSON config = Config.from_json('{"timeout_secs": 30}') # Use with client client = PocketOptionAsync(ssid="your-ssid", config=config) ``` --- ## Logging - start_logs / start_tracing Initialize the logging system for debugging and monitoring. Supports file output and terminal display. ```python from BinaryOptionsToolsV2.tracing import start_logs, LogBuilder # Simple logging setup start_logs( path="./logs", level="DEBUG", terminal=True ) # Advanced setup with LogBuilder builder = LogBuilder() builder.terminal(level="INFO") builder.log_file(path="./logs/app.log", level="DEBUG") builder.build() # Or use start_tracing for minimal setup from BinaryOptionsToolsV2 import start_tracing start_tracing("info") # Just enable info-level logging ``` --- ## Synchronous API Usage Complete example using the synchronous PocketOption client for simpler scripts. ```python from datetime import timedelta from BinaryOptionsToolsV2.pocketoption import PocketOption from BinaryOptionsToolsV2.validator import Validator def main(): with PocketOption(ssid="your-ssid") as client: # Account info print(f"Balance: ${client.balance()}") print(f"Demo: {client.is_demo()}") print(f"Server Time: {client.get_server_time()}") # Get payouts payout = client.payout("EURUSD_otc") print(f"EURUSD_otc Payout: {payout}%") # Historical data candles = client.get_candles("EURUSD_otc", 60, 3600) print(f"Retrieved {len(candles)} candles") # Place trade trade_id, deal = client.buy("EURUSD_otc", 1.0, 60) print(f"Trade ID: {trade_id}") # Check result result = client.check_win(trade_id) print(f"Result: {result['result']}") # Real-time streaming stream = client.subscribe_symbol_timed("EURUSD_otc", timedelta(seconds=5)) for i, candle in enumerate(stream): print(f"Live: {candle['close']}") if i >= 2: break # Deal management print(f"Open deals: {len(client.opened_deals())}") print(f"Closed deals: {len(client.closed_deals())}") if __name__ == "__main__": main() ``` --- ## UniFFI Cross-Platform Bindings BinaryOptionsToolsUni provides native bindings for multiple languages from the same Rust core. Available for Kotlin, Swift, Go, C#, Ruby, and Python. ```kotlin // Kotlin Example import com.chipadevteam.binaryoptionstoolsuni.* import kotlinx.coroutines.* suspend fun main() = coroutineScope { val client = PocketOption.init("your_ssid") delay(2000) val balance = client.balance() println("Balance: $$balance") val trade = client.buy("EURUSD_otc", 60u, 1.0) println("Trade ID: ${trade.id}") } ``` ```swift // Swift Example import BinaryOptionsToolsUni Task { let client = try await PocketOption.init(ssid: "your_ssid") let balance = await client.balance() print("Balance: $\(balance)") let trade = try await client.buy(asset: "EURUSD_otc", time: 60, amount: 1.0) print("Trade ID: \(trade.id)") } ``` ```go // Go Example package main import ( "fmt" bot "binaryoptionstoolsuni" ) func main() { client, _ := bot.PocketOptionInit("your_ssid") balance := client.Balance() fmt.Printf("Balance: $%.2f\n", balance) trade, _ := client.Buy("EURUSD_otc", 60, 1.0) fmt.Printf("Trade ID: %s\n", trade.Id) } ``` --- ## Summary BinaryOptionsTools V2 provides a comprehensive toolkit for automated binary options trading on PocketOption (with ExpertOption in alpha). The library excels at real-time market data streaming, instant trade execution, and building sophisticated trading bots through its event-driven PyStrategy framework. Key integration patterns include using the async context manager for connection lifecycle management, leveraging validators for filtering WebSocket messages, and implementing custom strategies that respond to candle and tick events. The library supports multiple deployment scenarios: from simple synchronous scripts for quick trades to complex async applications handling multiple assets simultaneously, to cross-platform applications via UniFFI bindings. Common integration patterns include connecting to historical data APIs for backtesting, streaming real-time prices for signal generation, and using the Raw Handler API for custom protocol extensions. The Rust core ensures high performance and memory safety, while Python bindings provide an accessible interface for rapid strategy development and testing.