Skip to main content

A library to connect to PocketOption using python with async and sync support.

Project description

👉 Join us on Discord

BinaryOptionsToolsV2

Comprehensive Documentation for BinaryOptionsToolsV2

  1. __init__.py

This file initializes the Python module and organizes the imports for both synchronous and asynchronous functionality.

Key Details

  • Imports BinaryOptionsToolsV2: Imports all elements and documentation from the Rust module.
  • Includes Submodules: Imports and exposes pocketoption and tracing modules for user convenience.

Purpose

Serves as the entry point for the package, exposing all essential components of the library.

Inside the pocketoption folder there are 2 main files

  1. asyncronous.py

This file implements the PocketOptionAsync class, which provides an asynchronous interface to interact with Pocket Option.

Key Features of PocketOptionAsync

  • Trade Operations:
    • buy(): Places a buy trade asynchronously.
    • sell(): Places a sell trade asynchronously.
    • check_win(): Checks the outcome of a trade ('win', 'draw', or 'loss').
  • Market Data:
    • get_candles(): Fetches historical candle data.
    • history(): Retrieves recent data for a specific asset.
  • Account Management:
    • balance(): Returns the current account balance.
    • opened_deals(): Lists all open trades.
    • closed_deals(): Lists all closed trades.
    • payout(): Returns payout percentages.
  • Real-Time Data:
    • subscribe_symbol(): Provides an asynchronous iterator for real-time candle updates.

Helper Class - AsyncSubscription

Facilitates asynchronous iteration over live data streams, enabling non-blocking operations.

Example Usage

from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync 
import asyncio 
 
async def main(): 
    client = PocketOptionAsync(ssid="your-session-id") 
    await asyncio.sleep(5)
    balance = await client.balance() 
    print("Account Balance:", balance) 
 
asyncio.run(main()) 
  1. syncronous.py

This file implements the PocketOption class, a synchronous wrapper around the asynchronous interface provided by PocketOptionAsync.

Key Features of PocketOption

  • Trade Operations:
    • buy(): Places a buy trade using synchronous execution.
    • sell(): Places a sell trade.
    • check_win(): Checks the trade outcome synchronously.
  • Market Data:
    • get_candles(): Fetches historical candle data.
    • history(): Retrieves recent data for a specific asset.
  • Account Management:
    • balance(): Retrieves account balance.
    • opened_deals(): Lists all open trades.
    • closed_deals(): Lists all closed trades.
    • payout(): Returns payout percentages.
  • Real-Time Data:
    • subscribe_symbol(): Provides a synchronous iterator for live data updates.

Helper Class - SyncSubscription

Allows synchronous iteration over real-time data streams for compatibility with simpler scripts.

Example Usage

from BinaryOptionsToolsV2.pocketoption import PocketOption 
import time

client = PocketOption(ssid="your-session-id") 
time.sleep(5)
balance = client.balance() 
print("Account Balance:", balance) 
  1. Differences Between PocketOption and PocketOptionAsync
Feature PocketOption (Synchronous) PocketOptionAsync (Asynchronous)
Execution Type Blocking Non-blocking
Use Case Simpler scripts High-frequency or real-time tasks
Performance Slower for concurrent tasks Scales well with concurrent operations

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BinaryOptionsToolsV2-0.1.6a1.tar.gz (136.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

BinaryOptionsToolsV2-0.1.6a1-cp312-none-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.12Windows x86-64

BinaryOptionsToolsV2-0.1.6a1-cp311-none-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11Windows x86-64

BinaryOptionsToolsV2-0.1.6a1-cp310-none-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.10Windows x86-64

BinaryOptionsToolsV2-0.1.6a1-cp39-none-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.9Windows x86-64

File details

Details for the file BinaryOptionsToolsV2-0.1.6a1.tar.gz.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a1.tar.gz
Algorithm Hash digest
SHA256 1108126fe155fa21bc2a23ab1b202b2e9b16e23b09eb49aa5dedae111e657948
MD5 d0de6d1638f0fae0ae71b1f6365833e7
BLAKE2b-256 a3384e985601b31d80d7b171b3d1ab1f44cef46e207b54abbd0561a25d64f4c7

See more details on using hashes here.

File details

Details for the file BinaryOptionsToolsV2-0.1.6a1-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a1-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 4d5f71a8fd0ef05d914b861ab9806a5ff824274de1a91279945965d2c3563725
MD5 abd525fd31600e45a6f0ff94bb4e5ae1
BLAKE2b-256 7b3de4a6ae6da1689b2fee2d4f5aa796189b2339e04f40f9a3c328606bb178d3

See more details on using hashes here.

File details

Details for the file BinaryOptionsToolsV2-0.1.6a1-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 dff76a763339e553934bf6470e9e395f484607465b9c99080efc805fb06b3be3
MD5 9f45b8f4eef5312fcc9b07cda59b0579
BLAKE2b-256 a1c977138d84f6a3d8184e2c06c6a36606ed8073bac4a837effb908b75db8a7e

See more details on using hashes here.

File details

Details for the file BinaryOptionsToolsV2-0.1.6a1-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 15bd00fe8f68e7c99a873e0213a84901fc36f2d24c5afa605da6d0e709db4fa8
MD5 d1f8448786a6494dd8ee6fe50b58139c
BLAKE2b-256 a3eb22cbcd4ce7b2f13da88ebf60f222ac2dee248e2258ff7d7870e809f06fa1

See more details on using hashes here.

File details

Details for the file BinaryOptionsToolsV2-0.1.6a1-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a1-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 4f09d66cf573e041468cdc129a6487b546c305237475b2cf2fc7982f5d84d821
MD5 ab1045e89e8379e67d4149faf8b3d38f
BLAKE2b-256 14e1f25d6ce268f4ef2aa8bcc2fa907046c8dba61b670fa125ace2c825c00a94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page