binaryoptionstoolsv2 0.2.1__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust}/Cargo.toml +17 -13
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust}/LICENSE +36 -32
- binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust/Readme.md +479 -0
- binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust/build.rs +28 -0
- binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust/src/config.rs +101 -0
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust}/src/error.rs +4 -2
- binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust/src/framework.rs +435 -0
- binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust/src/lib.rs +42 -0
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust}/src/logs.rs +321 -323
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust}/src/pocketoption.rs +1044 -782
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust}/src/stream.rs +36 -36
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust}/src/validator.rs +63 -18
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9}/Cargo.lock +1513 -835
- binaryoptionstoolsv2-0.2.9/Cargo.toml +18 -0
- binaryoptionstoolsv2-0.2.9/LICENSE +100 -0
- binaryoptionstoolsv2-0.2.9/PKG-INFO +516 -0
- binaryoptionstoolsv2-0.2.9/Readme.md +479 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/Cargo.lock +570 -728
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/Cargo.toml +46 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/LICENSE +100 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/Readme.md +268 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/data/expert_options_regions.json +72 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/data/pocket_options_regions.json +37 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/config.rs +56 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/error.rs +33 -29
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/client.rs +7 -3
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/connect.rs +105 -89
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/modules/keep_alive.rs +77 -76
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/modules/profile.rs +387 -370
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/regions.rs +1 -1
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/state.rs +122 -122
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/types.rs +8 -4
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/framework/market.rs +24 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/framework/mod.rs +174 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/framework/virtual_market.rs +362 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/lib.rs +9 -10
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/candle.rs +808 -490
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/connect.rs +101 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/error.rs +11 -1
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/assets.rs +263 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/balance.rs +84 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/deals.rs +381 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +66 -38
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +1041 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +305 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/modules/mod.rs +11 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +332 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs +805 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/modules/raw.rs +359 -341
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/resilient_parsing_tests.rs +118 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/modules/server_time.rs +16 -7
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +981 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/trades.rs +323 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/trades_tests/common.rs +176 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/trades_tests/concurrency.rs +113 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/trades_tests/mod.rs +2 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/pocket_client.rs +1375 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/regions.rs +13 -5
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/ssid.rs +393 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/state.rs +408 -325
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/types.rs +800 -585
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/utils.rs +226 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/utils/mod.rs +151 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/utils/serialize.rs +58 -0
- binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/validator.rs +256 -0
- binaryoptionstoolsv2-0.2.9/crates/core/Cargo.lock +1994 -0
- binaryoptionstoolsv2-0.2.9/crates/core/Cargo.toml +38 -0
- binaryoptionstoolsv2-0.2.9/crates/core/LICENSE +100 -0
- binaryoptionstoolsv2-0.2.9/crates/core/data/batching.rs +218 -0
- binaryoptionstoolsv2-0.2.9/crates/core/data/client2.rs +1001 -0
- binaryoptionstoolsv2-0.2.9/crates/core/data/client_enhanced.rs +1011 -0
- binaryoptionstoolsv2-0.2.9/crates/core/data/connection.rs +294 -0
- binaryoptionstoolsv2-0.2.9/crates/core/data/events.rs +242 -0
- binaryoptionstoolsv2-0.2.9/crates/core/data/websocket_config.rs +228 -0
- binaryoptionstoolsv2-0.2.9/crates/core/errors.log +0 -0
- binaryoptionstoolsv2-0.2.9/crates/core/readme.md +37 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/constants.rs +7 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/error.rs +82 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/general/client.rs +700 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/general/config.rs +63 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/general/mod.rs +8 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/general/send.rs +304 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/general/stream.rs +121 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/general/traits.rs +113 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/general/types.rs +163 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/general/validate.rs +19 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/lib.rs +9 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/reimports.rs +5 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/utils/mod.rs +2 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/utils/time.rs +19 -0
- binaryoptionstoolsv2-0.2.9/crates/core/src/utils/tracing.rs +109 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/Cargo.toml +7 -6
- binaryoptionstoolsv2-0.2.9/crates/core-pre/LICENSE +100 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/README.md +252 -252
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/docs/testing-framework.md +583 -584
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/examples/echo_client.rs +359 -353
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/examples/middleware_example.rs +247 -246
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/examples/testing_echo_client.rs +276 -273
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/builder.rs +483 -444
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/client.rs +541 -537
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/middleware.rs +6 -3
- binaryoptionstoolsv2-0.2.9/crates/core-pre/src/reimports.rs +7 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/signals.rs +45 -45
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/statistics.rs +822 -822
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/traits.rs +21 -1
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/utils/stream.rs +115 -115
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/utils/tracing.rs +116 -116
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/tests/middleware_tests.rs +169 -169
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/tests/testing_wrapper_tests.rs +2 -1
- binaryoptionstoolsv2-0.2.9/crates/macros/.gitignore +2 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/ActionImpl_README.md +132 -132
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/Cargo.lock +103 -132
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/Cargo.toml +3 -3
- binaryoptionstoolsv2-0.2.9/crates/macros/LICENSE +100 -0
- binaryoptionstoolsv2-0.2.9/crates/macros/readme.md +1 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/action.rs +87 -87
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/config.rs +366 -366
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/deserialize.rs +26 -26
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/lib.rs +75 -75
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/region.rs +184 -184
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/serialize.rs +21 -21
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/timeout.rs +158 -158
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/pyproject.toml +19 -3
- binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/BinaryOptionsToolsV2.pyi +155 -0
- binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/__init__.py +54 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9/python}/BinaryOptionsToolsV2/config.py +151 -193
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/python}/BinaryOptionsToolsV2/pocketoption/__init__.py +5 -5
- binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/pocketoption/asynchronous.py +1402 -0
- binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/pocketoption/synchronous.py +724 -0
- binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/tracing.py +96 -0
- binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/validator.py +198 -0
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/.github/workflows/CI.yml +0 -169
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/.gitignore +0 -75
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/BinaryOptionsToolsV2/__init__.py +0 -10
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/BinaryOptionsToolsV2/config.py +0 -193
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/asyncronous.py +0 -653
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/BinaryOptionsToolsV2/pocketoption/syncronous.py +0 -479
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/BinaryOptionsToolsV2/tracing.py +0 -148
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/BinaryOptionsToolsV2/validator.py +0 -278
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/CI.yml +0 -345
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/Dockerfile +0 -37
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/PYTHON_API_REFERENCE.md +0 -727
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/Readme.md +0 -221
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/__init__.py +0 -10
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/candles_eurusd_otc.csv +0 -1637
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/pocketoption/__init__.py +0 -19
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/pocketoption/asyncronous.py +0 -653
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/pocketoption/syncronous.py +0 -479
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/src/config.rs +0 -60
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/src/lib.rs +0 -35
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/tests/test.py +0 -36
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/tests/test_sync.py +0 -17
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/tracing.py +0 -148
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/uv.lock +0 -7
- binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2/validator.py +0 -278
- binaryoptionstoolsv2-0.2.1/PKG-INFO +0 -256
- binaryoptionstoolsv2-0.2.1/Readme.md +0 -221
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/.gitignore +0 -4
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/Cargo.toml +0 -47
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/Readme.md +0 -89
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/errors.log +0 -535
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/expert_options_regions.json +0 -37
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/image.png +0 -0
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/mkds/README.md +0 -96
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/pocket_options_regions.json +0 -121
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/connect.rs +0 -76
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/modules/assets.rs +0 -103
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/modules/balance.rs +0 -78
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/modules/deals.rs +0 -328
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +0 -127
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +0 -799
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/modules/trades.rs +0 -213
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/pocket_client.rs +0 -625
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/ssid.rs +0 -199
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/pocketoption/utils.rs +0 -136
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/utils/mod.rs +0 -61
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/utils/serialize.rs +0 -19
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/src/validator.rs +0 -117
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/assets.txt +0 -176
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/assets2.json +0 -9634
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/assets3.json +0 -5925
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/data.json +0 -5674
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/expert_multiple_actions.json +0 -6879
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/fail_open_pending_order.json +0 -20
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/fail_open_pending_order2.json +0 -21
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/load_history_period.json +0 -1357
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/load_history_period2.json +0 -4161
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/pocketoption_client_tests.rs +0 -89
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/profile.json +0 -47
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/raw_module_tests.rs +0 -223
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/success_close_order.json +0 -28
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/success_open_order.json +0 -23
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/success_open_pending_order.json +0 -15
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/success_update_pending.json +0 -62
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/test.json +0 -6
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/test_close_order.txt +0 -54
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/test_demo.json +0 -6
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/update_close_order.json +0 -120
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/update_closed_deals.txt +0 -582
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/update_history_new.json +0 -1265
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/update_history_new_fast.json +0 -1637
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/update_opened_deals.txt +0 -98
- binaryoptionstoolsv2-0.2.1/crates/binary_options_tools/tests/validator_tests.rs +0 -142
- binaryoptionstoolsv2-0.2.1/crates/core-pre/src/reimports.rs +0 -6
- binaryoptionstoolsv2-0.2.1/crates/core-pre/target/.rustc_info.json +0 -1
- binaryoptionstoolsv2-0.2.1/crates/core-pre/target/package/binary-options-tools-core-pre-0.1.1.crate +0 -0
- binaryoptionstoolsv2-0.2.1/crates/core-pre/target/rust-analyzer/metadata/sysroot/Cargo.lock +0 -503
- binaryoptionstoolsv2-0.2.1/crates/macros/readme.md +0 -1
- {binaryoptionstoolsv2-0.2.1/BinaryOptionsToolsV2 → binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust}/src/runtime.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/action.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/expertoptions/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/pocketoption/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/reimports.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/binary_options_tools/src/traits.rs +0 -0
- {binaryoptionstoolsv2-0.2.1/crates/macros → binaryoptionstoolsv2-0.2.9/crates/core}/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/.vscode/mcp.json +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/diagrams/architecture.txt +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/diagrams/diagram.txt +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/examples/basic_connector_usage.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/callback.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/connector.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/message.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/testing.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/utils/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/core-pre/src/utils/time.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/examples/action_example.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/impls/config_impl.rs +0 -0
- {binaryoptionstoolsv2-0.2.1 → binaryoptionstoolsv2-0.2.9}/crates/macros/src/impls/mod.rs +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "BinaryOptionsToolsV2"
|
|
3
|
-
version = "0.2.
|
|
4
|
-
edition = "
|
|
3
|
+
version = "0.2.9"
|
|
4
|
+
edition = "2021"
|
|
5
5
|
authors = ["ChipaDevTeam"]
|
|
6
6
|
description = "Python bindings for binary-options-tools. High-performance library for PocketOption trading automation with async/sync support, real-time data streaming, and WebSocket API access."
|
|
7
7
|
license-file = "LICENSE"
|
|
@@ -18,25 +18,29 @@ name = "BinaryOptionsToolsV2"
|
|
|
18
18
|
crate-type = ["cdylib"]
|
|
19
19
|
|
|
20
20
|
[dependencies]
|
|
21
|
-
pyo3 = { version = "0.
|
|
22
|
-
|
|
23
|
-
"chrono",
|
|
24
|
-
"abi3-py38",
|
|
25
|
-
] }
|
|
26
|
-
pyo3-async-runtimes = { version = "0.27.0", features = ["tokio-runtime"] }
|
|
21
|
+
pyo3 = { version = "0.28.2", features = ["abi3-py39"] }
|
|
22
|
+
pyo3-async-runtimes = { version = "0.28.0", features = ["tokio-runtime"] }
|
|
27
23
|
|
|
28
|
-
binary_options_tools = { path = "
|
|
24
|
+
binary_options_tools = { path = "../../crates/binary_options_tools", version = "0.2.0" }
|
|
29
25
|
|
|
30
|
-
thiserror = "2.0.
|
|
26
|
+
thiserror = "2.0.18"
|
|
31
27
|
serde = { version = "1.0.228", features = ["derive"] }
|
|
32
28
|
serde_json = "1.0.142"
|
|
33
29
|
uuid = "1.18.0"
|
|
34
30
|
tracing = "0.1.41"
|
|
35
|
-
tokio = "1.
|
|
31
|
+
tokio = { version = "1.49.0", features = ["rt-multi-thread", "macros", "net", "time", "sync"] }
|
|
36
32
|
futures-util = "0.3.31"
|
|
37
|
-
tracing-subscriber = { version = "0.3.
|
|
33
|
+
tracing-subscriber = { version = "0.3.22", features = ["env-filter"] }
|
|
38
34
|
chrono = "0.4.42"
|
|
39
35
|
url = "2.5.7"
|
|
40
36
|
regex = "1.12.2"
|
|
41
37
|
async-stream = "0.3.6"
|
|
42
|
-
|
|
38
|
+
async-trait = "0.1.86"
|
|
39
|
+
tungstenite = { version = "0.28.0", default-features = false, features = ["rustls-tls-webpki-roots", "handshake"] }
|
|
40
|
+
rust_decimal = "1.40.0"
|
|
41
|
+
rust_decimal_macros = "1.40.0"
|
|
42
|
+
pyo3-stub-gen = { version = "0.7.0", optional = true }
|
|
43
|
+
|
|
44
|
+
[features]
|
|
45
|
+
default = []
|
|
46
|
+
stubgen = ["pyo3-stub-gen"]
|
|
@@ -6,64 +6,67 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
|
6
6
|
|
|
7
7
|
1. DEFINITIONS
|
|
8
8
|
|
|
9
|
-
"Software" refers to BinaryOptionsTools v2 and all associated documentation,
|
|
9
|
+
"Software" refers to BinaryOptionsTools v2 and all associated documentation,
|
|
10
10
|
source code, binaries, and related materials.
|
|
11
11
|
|
|
12
|
-
"Personal Use" means use by individuals for non-commercial, educational,
|
|
12
|
+
"Personal Use" means use by individuals for non-commercial, educational,
|
|
13
13
|
research, or personal trading purposes.
|
|
14
14
|
|
|
15
|
-
"Commercial Use" means use of the Software in any manner primarily intended
|
|
16
|
-
for commercial advantage or monetary compensation, including but not limited
|
|
17
|
-
to: selling access to the Software, using the Software as part of a paid
|
|
15
|
+
"Commercial Use" means use of the Software in any manner primarily intended
|
|
16
|
+
for commercial advantage or monetary compensation, including but not limited
|
|
17
|
+
to: selling access to the Software, using the Software as part of a paid
|
|
18
18
|
service, or integrating the Software into commercial products.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
1. GRANT OF LICENSE
|
|
21
21
|
|
|
22
22
|
2.1 Personal Use License
|
|
23
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
-
of this Software, to use, copy, modify, and distribute the Software for
|
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
+
of this Software, to use, copy, modify, and distribute the Software for
|
|
25
25
|
Personal Use only, subject to the following conditions:
|
|
26
26
|
|
|
27
|
-
a) The above copyright notice and this permission notice shall be included in
|
|
27
|
+
a) The above copyright notice and this permission notice shall be included in
|
|
28
28
|
all copies or substantial portions of the Software.
|
|
29
29
|
b) This Software is provided "AS IS" for Personal Use only.
|
|
30
30
|
|
|
31
31
|
2.2 Commercial Use License
|
|
32
|
-
Commercial Use of this Software requires explicit written permission from
|
|
32
|
+
Commercial Use of this Software requires explicit written permission from
|
|
33
33
|
ChipaDevTeam. To request permission for Commercial Use, contact us at:
|
|
34
|
-
- Discord: https://discord.gg/p7YyFqSmAz
|
|
35
|
-
- GitHub: https://github.com/ChipaDevTeam
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
- Discord: <https://discord.gg/p7YyFqSmAz>
|
|
36
|
+
- GitHub: <https://github.com/ChipaDevTeam>
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
41
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
38
|
+
1. DISCLAIMER OF WARRANTY
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
41
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
42
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
1. LIMITATION OF LIABILITY
|
|
45
|
+
|
|
46
|
+
IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS, OR CHIPADEVTEAM BE LIABLE
|
|
47
|
+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
48
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
|
48
49
|
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
49
50
|
|
|
50
51
|
The authors and ChipaDevTeam are not responsible for:
|
|
52
|
+
|
|
51
53
|
- Any financial losses incurred from using this Software
|
|
52
54
|
- Any trading decisions made using this Software
|
|
53
55
|
- Any bugs, errors, or issues in the Software
|
|
54
|
-
- Any consequences of using this Software for trading binary options or
|
|
56
|
+
- Any consequences of using this Software for trading binary options or
|
|
55
57
|
other financial instruments
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
1. RISK WARNING
|
|
58
60
|
|
|
59
|
-
Binary options trading carries significant risk. This Software is provided
|
|
61
|
+
Binary options trading carries significant risk. This Software is provided
|
|
60
62
|
for educational and personal use only. Users should:
|
|
63
|
+
|
|
61
64
|
- Never risk more than they can afford to lose
|
|
62
65
|
- Understand the risks involved in binary options trading
|
|
63
66
|
- Comply with all applicable laws and regulations
|
|
64
67
|
- Use the Software at their own risk
|
|
65
68
|
|
|
66
|
-
|
|
69
|
+
1. DISTRIBUTION
|
|
67
70
|
|
|
68
71
|
You may distribute copies of the Software for Personal Use, provided that:
|
|
69
72
|
a) You include this license file
|
|
@@ -71,7 +74,7 @@ b) You clearly indicate this is for Personal Use only
|
|
|
71
74
|
c) You do not charge for distribution
|
|
72
75
|
d) You preserve all copyright notices
|
|
73
76
|
|
|
74
|
-
|
|
77
|
+
1. MODIFICATIONS
|
|
75
78
|
|
|
76
79
|
You may modify the Software for Personal Use. Modified versions:
|
|
77
80
|
a) Must retain this license
|
|
@@ -79,18 +82,19 @@ b) Must clearly indicate they are modified versions
|
|
|
79
82
|
c) Cannot be used for Commercial Use without permission
|
|
80
83
|
d) Cannot remove or modify copyright notices
|
|
81
84
|
|
|
82
|
-
|
|
85
|
+
1. TERMINATION
|
|
83
86
|
|
|
84
|
-
This license automatically terminates if you violate any of its terms. Upon
|
|
87
|
+
This license automatically terminates if you violate any of its terms. Upon
|
|
85
88
|
termination, you must destroy all copies of the Software in your possession.
|
|
86
89
|
|
|
87
|
-
|
|
90
|
+
1. CONTACT
|
|
88
91
|
|
|
89
92
|
For Commercial Use licensing, questions, or permissions:
|
|
90
|
-
|
|
91
|
-
-
|
|
93
|
+
|
|
94
|
+
- Discord: <https://discord.gg/p7YyFqSmAz>
|
|
95
|
+
- GitHub: <https://github.com/ChipaDevTeam/BinaryOptionsTools-v2>
|
|
92
96
|
|
|
93
97
|
---
|
|
94
98
|
|
|
95
|
-
By using this Software, you acknowledge that you have read this license,
|
|
96
|
-
understand it, and agree to be bound by its terms and conditions.
|
|
99
|
+
By using this Software, you acknowledge that you have read this license,
|
|
100
|
+
understand it, and agree to be bound by its terms and conditions.
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
# BinaryOptionsToolsV2 - Python Package
|
|
2
|
+
|
|
3
|
+
[](https://discord.gg/T3FGXcmd)
|
|
4
|
+
[](https://pypi.org/project/binaryoptionstoolsv2/)
|
|
5
|
+
|
|
6
|
+
Python bindings for BinaryOptionsTools - A powerful library for automated binary options trading on PocketOption platform.
|
|
7
|
+
|
|
8
|
+
## Current Status
|
|
9
|
+
|
|
10
|
+
**Available Features**:
|
|
11
|
+
|
|
12
|
+
- **Authentication**: Secure connection with automated SSID sanitization.
|
|
13
|
+
- **Trading**: Instant Buy/Sell operations with real-time result tracking.
|
|
14
|
+
- **Account**: Balance retrieval, opened/closed deals management.
|
|
15
|
+
- **Market Data**: Real-time candle subscriptions (tick to 300s), historical data fetching.
|
|
16
|
+
- **Resilience**: Automated asset gathering, payout synchronization, and robust reconnection logic.
|
|
17
|
+
- **Advanced**: Raw WebSocket handler API and custom message validators.
|
|
18
|
+
|
|
19
|
+
## How to install
|
|
20
|
+
|
|
21
|
+
Install it via PyPI:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install binaryoptionstoolsv2
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Supported OS
|
|
28
|
+
|
|
29
|
+
Currently supported on **Windows**, **Linux**, and **macOS**.
|
|
30
|
+
|
|
31
|
+
## Supported Python versions
|
|
32
|
+
|
|
33
|
+
Supports **Python 3.8 to 3.13**.
|
|
34
|
+
|
|
35
|
+
## Compile from source (Not recommended)
|
|
36
|
+
|
|
37
|
+
- Make sure you have `rust` and `cargo` installed ([Check here](https://www.rust-lang.org/tools/install))
|
|
38
|
+
|
|
39
|
+
- Install [`maturin`](https://www.maturin.rs/installation) in order to compile the library
|
|
40
|
+
|
|
41
|
+
- Once the source is downloaded (using `git clone https://github.com/ChipaDevTeam/BinaryOptionsTools-v2.git`) execute the following commands:
|
|
42
|
+
To create the `.whl` file
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Inside the root folder
|
|
46
|
+
cd BinaryOptionsToolsV2
|
|
47
|
+
maturin build -r
|
|
48
|
+
|
|
49
|
+
# Once the command is executed it should print a path to a .whl file, copy it and then run
|
|
50
|
+
pip install path/to/file.whl
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
To install the library in a local virtual environment
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Inside the root folder
|
|
57
|
+
cd BinaryOptionsToolsV2
|
|
58
|
+
|
|
59
|
+
# Activate the virtual environment if not done already
|
|
60
|
+
|
|
61
|
+
# Execute the following command and it should automatically install the library in the VM
|
|
62
|
+
maturin develop
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Docs
|
|
66
|
+
|
|
67
|
+
Comprehensive Documentation for BinaryOptionsToolsV2
|
|
68
|
+
|
|
69
|
+
1. `__init__.py`
|
|
70
|
+
|
|
71
|
+
This file initializes the Python module and organizes the imports for both synchronous and asynchronous functionality.
|
|
72
|
+
|
|
73
|
+
Key Details
|
|
74
|
+
|
|
75
|
+
- **Imports `BinaryOptionsToolsV2`**: Imports all elements and documentation from the Rust module.
|
|
76
|
+
- **Includes Submodules**: Imports and exposes `pocketoption` and `tracing` modules for user convenience.
|
|
77
|
+
|
|
78
|
+
Purpose
|
|
79
|
+
|
|
80
|
+
Serves as the entry point for the package, exposing all essential components of the library.
|
|
81
|
+
|
|
82
|
+
### Inside the `pocketoption` folder there are 2 main files
|
|
83
|
+
|
|
84
|
+
1. `asynchronous.py`
|
|
85
|
+
|
|
86
|
+
This file implements the `PocketOptionAsync` class, which provides an asynchronous interface to interact with Pocket Option.
|
|
87
|
+
|
|
88
|
+
Key Features of PocketOptionAsync
|
|
89
|
+
|
|
90
|
+
- **Trade Operations**:
|
|
91
|
+
- `buy()`: Places a buy trade asynchronously.
|
|
92
|
+
- `sell()`: Places a sell trade asynchronously.
|
|
93
|
+
- `check_win()`: Checks the outcome of a trade ('win', 'draw', or 'loss').
|
|
94
|
+
- **Market Data**:
|
|
95
|
+
- `get_candles()`: Fetches historical candle data.
|
|
96
|
+
- `history()`: Retrieves recent data for a specific asset.
|
|
97
|
+
- `compile_candles()`: Compiles custom-period candlesticks from base candle data.
|
|
98
|
+
- **Account Management**:
|
|
99
|
+
- `balance()`: Returns the current account balance.
|
|
100
|
+
- `opened_deals()`: Lists all open trades.
|
|
101
|
+
- `closed_deals()`: Lists all closed trades.
|
|
102
|
+
- `payout()`: Returns payout percentages.
|
|
103
|
+
- **Real-Time Data**:
|
|
104
|
+
- `subscribe_symbol()`: Provides an asynchronous iterator for real-time candle updates.
|
|
105
|
+
- `subscribe_symbol_timed()`: Provides an asynchronous iterator for timed real-time candle updates.
|
|
106
|
+
- `subscribe_symbol_chunked()`: Provides an asynchronous iterator for chunked real-time candle updates.
|
|
107
|
+
- **Server Information**:
|
|
108
|
+
- `server_time()`: Gets the current server time.
|
|
109
|
+
- **Connection Management**:
|
|
110
|
+
- `reconnect()`: Manually reconnect to the server.
|
|
111
|
+
- `shutdown()`: Properly close the connection.
|
|
112
|
+
|
|
113
|
+
Helper Class - `AsyncSubscription`
|
|
114
|
+
|
|
115
|
+
Facilitates asynchronous iteration over live data streams, enabling non-blocking operations.
|
|
116
|
+
|
|
117
|
+
Example Usage
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync
|
|
121
|
+
import asyncio
|
|
122
|
+
|
|
123
|
+
async def main():
|
|
124
|
+
# Initialize the client
|
|
125
|
+
client = PocketOptionAsync(ssid="your-session-id")
|
|
126
|
+
|
|
127
|
+
# Get account balance
|
|
128
|
+
balance = await client.balance()
|
|
129
|
+
print(f"Account Balance: ${balance}")
|
|
130
|
+
|
|
131
|
+
# Place a buy trade
|
|
132
|
+
trade_id, deal = await client.buy("EURUSD_otc", 1.0, 60)
|
|
133
|
+
print(f"Trade placed: {deal}")
|
|
134
|
+
|
|
135
|
+
# Check result
|
|
136
|
+
result = await client.check_win(trade_id)
|
|
137
|
+
print(f"Trade result: {result}")
|
|
138
|
+
|
|
139
|
+
# Subscribe to real-time data
|
|
140
|
+
async for candle in client.subscribe_symbol("EURUSD_otc"):
|
|
141
|
+
print(f"New candle: {candle}")
|
|
142
|
+
break # Just print one candle for demo
|
|
143
|
+
|
|
144
|
+
asyncio.run(main())
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
1. `synchronous.py`
|
|
148
|
+
|
|
149
|
+
This file implements the `PocketOption` class, a synchronous wrapper around the asynchronous interface provided by `PocketOptionAsync`.
|
|
150
|
+
|
|
151
|
+
Key Features of PocketOption
|
|
152
|
+
|
|
153
|
+
- **Trade Operations**:
|
|
154
|
+
- `buy()`: Places a buy trade using synchronous execution.
|
|
155
|
+
- `sell()`: Places a sell trade.
|
|
156
|
+
- `check_win()`: Checks the trade outcome synchronously.
|
|
157
|
+
- **Market Data**:
|
|
158
|
+
- `get_candles()`: Fetches historical candle data.
|
|
159
|
+
- `history()`: Retrieves recent data for a specific asset.
|
|
160
|
+
- `compile_candles()`: Compiles custom-period candlesticks from base candle data.
|
|
161
|
+
- **Account Management**:
|
|
162
|
+
- `balance()`: Retrieves account balance.
|
|
163
|
+
- `opened_deals()`: Lists all open trades.
|
|
164
|
+
- `closed_deals()`: Lists all closed trades.
|
|
165
|
+
- `payout()`: Returns payout percentages.
|
|
166
|
+
- **Real-Time Data**:
|
|
167
|
+
- `subscribe_symbol()`: Provides a synchronous iterator for live data updates.
|
|
168
|
+
- `subscribe_symbol_timed()`: Provides a synchronous iterator for timed real-time candle updates.
|
|
169
|
+
- `subscribe_symbol_chunked()`: Provides a synchronous iterator for chunked real-time candle updates.
|
|
170
|
+
- **Server Information**:
|
|
171
|
+
- `server_time()`: Gets the current server time.
|
|
172
|
+
- **Connection Management**:
|
|
173
|
+
- `reconnect()`: Manually reconnect to the server.
|
|
174
|
+
- `shutdown()`: Properly close the connection.
|
|
175
|
+
|
|
176
|
+
Helper Class - `SyncSubscription`
|
|
177
|
+
|
|
178
|
+
Allows synchronous iteration over real-time data streams for compatibility with simpler scripts.
|
|
179
|
+
|
|
180
|
+
Example Usage
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOption
|
|
184
|
+
import time
|
|
185
|
+
|
|
186
|
+
# Initialize the client
|
|
187
|
+
client = PocketOption(ssid="your-session-id")
|
|
188
|
+
|
|
189
|
+
# Get account balance
|
|
190
|
+
balance = client.balance()
|
|
191
|
+
print(f"Account Balance: ${balance}")
|
|
192
|
+
|
|
193
|
+
# Place a buy trade
|
|
194
|
+
trade_id, deal = client.buy("EURUSD_otc", 1.0, 60)
|
|
195
|
+
print(f"Trade placed: {deal}")
|
|
196
|
+
|
|
197
|
+
# Check result
|
|
198
|
+
result = client.check_win(trade_id)
|
|
199
|
+
print(f"Trade result: {result}")
|
|
200
|
+
|
|
201
|
+
# Subscribe to real-time data
|
|
202
|
+
stream = client.subscribe_symbol("EURUSD_otc")
|
|
203
|
+
for candle in stream:
|
|
204
|
+
print(f"New candle: {candle}")
|
|
205
|
+
break # Just print one candle for demo
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
1. Differences Between PocketOption and PocketOptionAsync
|
|
209
|
+
|
|
210
|
+
| Feature | PocketOption (Synchronous) | PocketOptionAsync (Asynchronous) |
|
|
211
|
+
| ------------------ | --------------------------- | -------------------------------------- |
|
|
212
|
+
| **Execution Type** | Blocking | Non-blocking |
|
|
213
|
+
| **Use Case** | Simpler scripts | High-frequency or real-time tasks |
|
|
214
|
+
| **Performance** | Slower for concurrent tasks | Scales well with concurrent operations |
|
|
215
|
+
|
|
216
|
+
### Tracing
|
|
217
|
+
|
|
218
|
+
The `tracing` module provides functionality to initialize and manage logging for the application.
|
|
219
|
+
|
|
220
|
+
Key Functions of Tracing
|
|
221
|
+
|
|
222
|
+
- **start_logs()**:
|
|
223
|
+
- Initializes the logging system for the application.
|
|
224
|
+
- **Arguments**:
|
|
225
|
+
- `path` (str): Path where log files will be stored.
|
|
226
|
+
- `level` (str): Logging level (default is "DEBUG").
|
|
227
|
+
- `terminal` (bool): Whether to display logs in the terminal (default is True).
|
|
228
|
+
- **Returns**: None
|
|
229
|
+
- **Raises**: Exception if there's an error starting the logging system.
|
|
230
|
+
|
|
231
|
+
Example Usage
|
|
232
|
+
|
|
233
|
+
```python
|
|
234
|
+
from BinaryOptionsToolsV2.tracing import start_logs
|
|
235
|
+
|
|
236
|
+
# Initialize logging
|
|
237
|
+
start_logs(path="logs/", level="INFO", terminal=True)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## 📖 Detailed Examples
|
|
241
|
+
|
|
242
|
+
### Basic Trading Example (Synchronous)
|
|
243
|
+
|
|
244
|
+
```python
|
|
245
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOption
|
|
246
|
+
import time
|
|
247
|
+
|
|
248
|
+
def main():
|
|
249
|
+
# Initialize client
|
|
250
|
+
client = PocketOption(ssid="your-session-id")
|
|
251
|
+
|
|
252
|
+
# Get balance
|
|
253
|
+
balance = client.balance()
|
|
254
|
+
print(f"Current Balance: ${balance}")
|
|
255
|
+
|
|
256
|
+
# Place a buy trade on EURUSD for 60 seconds with $1
|
|
257
|
+
trade_id, deal = client.buy(asset="EURUSD_otc", amount=1.0, time=60)
|
|
258
|
+
print(f"Trade ID: {trade_id}")
|
|
259
|
+
print(f"Deal Data: {deal}")
|
|
260
|
+
|
|
261
|
+
# Wait for trade to complete (60 seconds)
|
|
262
|
+
time.sleep(65)
|
|
263
|
+
|
|
264
|
+
# Check the result
|
|
265
|
+
result = client.check_win(trade_id)
|
|
266
|
+
print(f"Trade Result: {result['result']}") # 'win', 'loss', or 'draw'
|
|
267
|
+
print(f"Profit: ${result.get('profit', 0)}")
|
|
268
|
+
|
|
269
|
+
if __name__ == "__main__":
|
|
270
|
+
main()
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Basic Trading Example (Asynchronous)
|
|
274
|
+
|
|
275
|
+
```python
|
|
276
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync
|
|
277
|
+
import asyncio
|
|
278
|
+
|
|
279
|
+
async def main():
|
|
280
|
+
# Initialize client
|
|
281
|
+
client = PocketOptionAsync(ssid="your-session-id")
|
|
282
|
+
|
|
283
|
+
# Get balance
|
|
284
|
+
balance = await client.balance()
|
|
285
|
+
print(f"Current Balance: ${balance}")
|
|
286
|
+
|
|
287
|
+
# Place a buy trade on EURUSD for 60 seconds with $1
|
|
288
|
+
trade_id, deal = await client.buy(asset="EURUSD_otc", amount=1.0, time=60)
|
|
289
|
+
print(f"Trade ID: {trade_id}")
|
|
290
|
+
print(f"Deal Data: {deal}")
|
|
291
|
+
|
|
292
|
+
# Wait for trade to complete (60 seconds)
|
|
293
|
+
await asyncio.sleep(65)
|
|
294
|
+
|
|
295
|
+
# Check the result
|
|
296
|
+
result = await client.check_win(trade_id)
|
|
297
|
+
print(f"Trade Result: {result['result']}") # 'win', 'loss', or 'draw'
|
|
298
|
+
print(f"Profit: ${result.get('profit', 0)}")
|
|
299
|
+
|
|
300
|
+
if __name__ == "__main__":
|
|
301
|
+
asyncio.run(main())
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Retrieving Historical Data
|
|
305
|
+
|
|
306
|
+
```python
|
|
307
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync
|
|
308
|
+
import asyncio
|
|
309
|
+
|
|
310
|
+
async def main():
|
|
311
|
+
client = PocketOptionAsync(ssid="your-session-id")
|
|
312
|
+
|
|
313
|
+
# Fetch historical data (60s candles, starting from now)
|
|
314
|
+
# Note: get_candles takes (asset, period, offset)
|
|
315
|
+
candles = await client.get_candles("EURUSD_otc", 60, 0)
|
|
316
|
+
|
|
317
|
+
print(f"Retrieved {len(candles)} candles")
|
|
318
|
+
if candles:
|
|
319
|
+
print("Last candle:", candles[-1])
|
|
320
|
+
# Output format:
|
|
321
|
+
# {
|
|
322
|
+
# 'time': 1770428373,
|
|
323
|
+
# 'open': 1.22354,
|
|
324
|
+
# 'high': 1.22355,
|
|
325
|
+
# 'low': 1.22354,
|
|
326
|
+
# 'close': 1.22355
|
|
327
|
+
# }
|
|
328
|
+
|
|
329
|
+
if __name__ == "__main__":
|
|
330
|
+
asyncio.run(main())
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Compiling Custom Period Candles
|
|
334
|
+
|
|
335
|
+
```python
|
|
336
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync
|
|
337
|
+
import asyncio
|
|
338
|
+
|
|
339
|
+
async def main():
|
|
340
|
+
client = PocketOptionAsync(ssid="your-session-id")
|
|
341
|
+
|
|
342
|
+
# Compile custom candles from raw tick data
|
|
343
|
+
# Parameters: asset, custom_period, lookback_period
|
|
344
|
+
candles = await client.compile_candles("EURUSD_otc", 60, 300)
|
|
345
|
+
|
|
346
|
+
print(f"Compiled {len(candles)} custom candles")
|
|
347
|
+
if candles:
|
|
348
|
+
print("Latest compiled candle:", candles[-1])
|
|
349
|
+
|
|
350
|
+
if __name__ == "__main__":
|
|
351
|
+
asyncio.run(main())
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Real-Time Data Subscription (Synchronous)
|
|
355
|
+
|
|
356
|
+
```python
|
|
357
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOption
|
|
358
|
+
import time
|
|
359
|
+
|
|
360
|
+
def main():
|
|
361
|
+
client = PocketOption(ssid="your-session-id")
|
|
362
|
+
|
|
363
|
+
# Subscribe to real-time candle data
|
|
364
|
+
stream = client.subscribe_symbol("EURUSD_otc")
|
|
365
|
+
|
|
366
|
+
print("Listening for real-time candles...")
|
|
367
|
+
for candle in stream:
|
|
368
|
+
print(f"Time: {candle.get('time')}")
|
|
369
|
+
print(f"Open: {candle.get('open')}")
|
|
370
|
+
print(f"High: {candle.get('high')}")
|
|
371
|
+
print(f"Low: {candle.get('low')}")
|
|
372
|
+
print(f"Close: {candle.get('close')}")
|
|
373
|
+
print("---")
|
|
374
|
+
|
|
375
|
+
if __name__ == "__main__":
|
|
376
|
+
main()
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Real-Time Data Subscription (Asynchronous)
|
|
380
|
+
|
|
381
|
+
```python
|
|
382
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync
|
|
383
|
+
import asyncio
|
|
384
|
+
|
|
385
|
+
async def main():
|
|
386
|
+
client = PocketOptionAsync(ssid="your-session-id")
|
|
387
|
+
|
|
388
|
+
# Subscribe to real-time candle data
|
|
389
|
+
async for candle in client.subscribe_symbol("EURUSD_otc"):
|
|
390
|
+
print(f"Time: {candle.get('time')}")
|
|
391
|
+
print(f"Open: {candle.get('open')}")
|
|
392
|
+
print(f"High: {candle.get('high')}")
|
|
393
|
+
print(f"Low: {candle.get('low')}")
|
|
394
|
+
print(f"Close: {candle.get('close')}")
|
|
395
|
+
print("---")
|
|
396
|
+
|
|
397
|
+
if __name__ == "__main__":
|
|
398
|
+
asyncio.run(main())
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Checking Opened Deals
|
|
402
|
+
|
|
403
|
+
```python
|
|
404
|
+
from BinaryOptionsToolsV2.pocketoption import PocketOption
|
|
405
|
+
import time
|
|
406
|
+
|
|
407
|
+
def main():
|
|
408
|
+
client = PocketOption(ssid="your-session-id")
|
|
409
|
+
|
|
410
|
+
# Get all opened deals
|
|
411
|
+
opened_deals = client.opened_deals()
|
|
412
|
+
|
|
413
|
+
if opened_deals:
|
|
414
|
+
print(f"You have {len(opened_deals)} opened deals:")
|
|
415
|
+
for deal in opened_deals:
|
|
416
|
+
print(f" - Trade ID: {deal.get('id')}")
|
|
417
|
+
print(f" Asset: {deal.get('asset')}")
|
|
418
|
+
print(f" Amount: ${deal.get('amount')}")
|
|
419
|
+
print(f" Direction: {deal.get('action')}")
|
|
420
|
+
else:
|
|
421
|
+
print("No opened deals")
|
|
422
|
+
|
|
423
|
+
if __name__ == "__main__":
|
|
424
|
+
main()
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## 🔑 Important Notes
|
|
428
|
+
|
|
429
|
+
### Connection Initialization
|
|
430
|
+
|
|
431
|
+
The client automatically establishes a connection during initialization. You can also manually manage the connection using `connect()`, `disconnect()`, and `reconnect()` methods.
|
|
432
|
+
|
|
433
|
+
```python
|
|
434
|
+
# Asynchronous
|
|
435
|
+
client = PocketOptionAsync(ssid="your-session-id")
|
|
436
|
+
# Connection is already established here
|
|
437
|
+
|
|
438
|
+
# Manual control
|
|
439
|
+
await client.disconnect()
|
|
440
|
+
await client.connect()
|
|
441
|
+
|
|
442
|
+
# Synchronous
|
|
443
|
+
client_sync = PocketOption(ssid="your-session-id")
|
|
444
|
+
# Connection is already established here
|
|
445
|
+
|
|
446
|
+
# Manual control
|
|
447
|
+
client_sync.disconnect()
|
|
448
|
+
client_sync.connect()
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Getting Your SSID
|
|
452
|
+
|
|
453
|
+
1. Go to [PocketOption](https://pocketoption.com)
|
|
454
|
+
2. Open Developer Tools (F12)
|
|
455
|
+
3. Go to Application/Storage → Cookies
|
|
456
|
+
4. Find the cookie named `ssid`
|
|
457
|
+
5. Copy its value
|
|
458
|
+
|
|
459
|
+
### Supported Assets
|
|
460
|
+
|
|
461
|
+
Common assets include:
|
|
462
|
+
|
|
463
|
+
- `EURUSD_otc` - Euro/US Dollar (OTC)
|
|
464
|
+
- `GBPUSD_otc` - British Pound/US Dollar (OTC)
|
|
465
|
+
- `USDJPY_otc` - US Dollar/Japanese Yen (OTC)
|
|
466
|
+
- `AUDUSD_otc` - Australian Dollar/US Dollar (OTC)
|
|
467
|
+
- And many more...
|
|
468
|
+
|
|
469
|
+
Use `_otc` suffix for over-the-counter (24/7 available) assets.
|
|
470
|
+
|
|
471
|
+
## 📚 Additional Resources
|
|
472
|
+
|
|
473
|
+
- **Full Examples**: [docs/examples/python](https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/tree/master/docs/examples/python)
|
|
474
|
+
- **API Documentation**: [https://chipadevteam.github.io/BinaryOptionsTools-v2/python.html](https://chipadevteam.github.io/BinaryOptionsTools-v2/python.html)
|
|
475
|
+
- **Discord Community**: [Join us](https://discord.gg/T3FGXcmd)
|
|
476
|
+
|
|
477
|
+
## ⚠️ Risk Warning
|
|
478
|
+
|
|
479
|
+
Trading binary options involves substantial risk and may result in the loss of all invested capital. This library is provided for educational purposes only. Always trade responsibly and never invest more than you can afford to lose.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#[cfg(feature = "stubgen")]
|
|
2
|
+
use pyo3_stub_gen::define_stub_info_gatherer;
|
|
3
|
+
use std::env;
|
|
4
|
+
#[cfg(feature = "stubgen")]
|
|
5
|
+
use std::path::PathBuf;
|
|
6
|
+
|
|
7
|
+
fn main() {
|
|
8
|
+
#[cfg(feature = "stubgen")]
|
|
9
|
+
{
|
|
10
|
+
// Define stub info gatherer function
|
|
11
|
+
define_stub_info_gatherer!(stub_info);
|
|
12
|
+
|
|
13
|
+
let crate_root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
|
14
|
+
let python_package_path = crate_root
|
|
15
|
+
.parent()
|
|
16
|
+
.unwrap()
|
|
17
|
+
.join("python")
|
|
18
|
+
.join("BinaryOptionsToolsV2");
|
|
19
|
+
|
|
20
|
+
// Ensure the target directory exists
|
|
21
|
+
std::fs::create_dir_all(&python_package_path)
|
|
22
|
+
.expect("Failed to create Python package directory");
|
|
23
|
+
|
|
24
|
+
// Generate stub file
|
|
25
|
+
let stub_info = stub_info().expect("Failed to gather stub info");
|
|
26
|
+
stub_info.generate().expect("Failed to generate stubs");
|
|
27
|
+
}
|
|
28
|
+
}
|