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.6a2.tar.gz (136.3 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.6a2-cp313-cp313-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86-64

BinaryOptionsToolsV2-0.1.6a2-cp313-cp313-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

BinaryOptionsToolsV2-0.1.6a2-cp312-cp312-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

BinaryOptionsToolsV2-0.1.6a2-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.6a2.tar.gz.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a2.tar.gz
Algorithm Hash digest
SHA256 7b65e1ed76402938c224906add4c241c395e008741558ee7e8bd6a09e1ae31d0
MD5 d27baaa26bee7d1fbc9551376bbc1104
BLAKE2b-256 5b05cb8416c11e086b3e31f678522941ec030056f0a7f9c38c7ca4fc03439f5d

See more details on using hashes here.

File details

Details for the file BinaryOptionsToolsV2-0.1.6a2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c3389ffed510af9b4fdf4a0f051fe5f5db7a6584cc9ebbb57a2656e7aaa4e668
MD5 968c6729d60fe964e372a287f809fa0e
BLAKE2b-256 2d5a68e17b3f05a718c960e20713a97658842441e9cd14d8ecdc75b0061ef185

See more details on using hashes here.

File details

Details for the file BinaryOptionsToolsV2-0.1.6a2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 66e23ac6aedd09a60839d799f3d0a7f9a771ba811a2fcc0c03a87543deb6aa80
MD5 0204d043577e399bcddffe26d5675ee2
BLAKE2b-256 ecd0abab41ede2f12e6cb17371fe7c435c8acfd0425a325b873306a80358344c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a2-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 00e7af79cfc4bea4af42f751b683c7b15741ae1d4d861dcc42529395255ce6b1
MD5 2b5833c0970b3e52e6912d19d8235c99
BLAKE2b-256 3ccd78d10ada9cc881a68e9dafdad49639d5ae2f93aee06115b0f7835d8c3bd2

See more details on using hashes here.

File details

Details for the file BinaryOptionsToolsV2-0.1.6a2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 43b197669d67ea301afb6b6bbaaf6ad4759d662fb1331bfe851037b7c168961f
MD5 054638e8a9ad773a515a19d116e2a462
BLAKE2b-256 674b162b90096309458d4817011a761f516e1fe158b79278e27d791d336cb277

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a2-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 0b37b8468889aabfabb8d3f54765d4a1eb79c35ab231ad2420be7245a8ee7ae6
MD5 5058ef94781066366a053da82a56a0bf
BLAKE2b-256 d4d8910a626f161ade448fddb335e4c422c805e499b42b2a8bf89a80c2864b69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 ac56f39bd00dd29a3c13b3cafea370a61d86c68b4fc2e4b5cae6a67d84213230
MD5 eac606f952d18e5bd103b357fa1dc4ef
BLAKE2b-256 474d97dd2c5b1dcc4491ee3827a0942d46f428f4de7860adb8f582eb0d65b4d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for BinaryOptionsToolsV2-0.1.6a2-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 f379036f3f4f8e78b5aa293245e493553ed1529aa9f8f440777c2bf3cda9efc2
MD5 9ba82103dbb5e39474a18e6d335daf41
BLAKE2b-256 946427519afc0aaf3774c35e4aefb3424edca0629641c873731a04f991608f5a

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