Skip to main content

This library contains Cybotrade's core runtime, integrations with Exchanges API, historical and live market data collector and wrap them into a simple, easy-to-use Python SDK.

Project description

Cybotrade

This is the Client SDK for building automated trading strategies on Cybotrade. This library provides the core runtime, integration with Exchanges API, historical and live market data collector and wrap them into a simple, easy-to-use and easy-to-learn Python SDK as a foundation users' strategies.

Documentation

The documentation for the Cybotrade SDK can be found here.

Installation

pip install cybotrade

Usage

The following example shows how to create a simple strategy that buys 0.01 BTC when the price goes up and sells 0.01 BTC when the price goes down.

For a more advanced usage, please refer to the documentation.

from cybotrade.strategy import Strategy as BaseStrategy
from cybotrade.models import (
    OrderParams, 
    OrderSide,
    RuntimeMode,
    RuntimeConfig,
    Exchange,
)
from datetime import datetime, timedelta, timezone

import asyncio

class Strategy(BaseStrategy):
    async def on_candle_closed(self, strategy, topic, symbol, data_map):
        # Get the currently closed candles
        candles = data_map[topic] 

        if candles[-1].close > candles[-2].close:
            # Buy 0.01 BTC
            await strategy.open(
                side=OrderSide.Buy,
                take_profit=None,
                stop_loss=None,
                quantity=0.01,
                limit=None
            )
        else:
            # Sell 0.01 BTC
            await strategy.open(
                side=OrderSide.Sell,
                take_profit=None,
                stop_loss=None,
                quantity=0.01,
                limit=None
            )

async def main():
    runtime = await Runtime.connect(
        RuntimeConfig(
            mode=RuntimeMode.Backtest,
            exchange=Exchange.BybitLinear,
            datasource_topics=[],
            candle_topics=["candles-1h-BTC/USDT-bybit"],
            start_time=datetime.now(timezone.utc) - timedelta(minutes=10000),
            end_time=datetime.now(timezone.utc),
            api_key="YOUR_CYBOTRADE_API_KEY",
            api_secret="YOUR_CYBOTRAD_API_SECRET",
            data_count=100
        ),
        Strategy(),
    )

    await runtime.start()

asyncio.run(main())

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

cybotrade-1.5.3-cp312-none-win_amd64.whl (13.9 MB view details)

Uploaded CPython 3.12Windows x86-64

cybotrade-1.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cybotrade-1.5.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

cybotrade-1.5.3-cp312-cp312-macosx_11_0_arm64.whl (11.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cybotrade-1.5.3-cp311-none-win_amd64.whl (13.8 MB view details)

Uploaded CPython 3.11Windows x86-64

cybotrade-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cybotrade-1.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

cybotrade-1.5.3-cp311-cp311-macosx_11_0_arm64.whl (11.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cybotrade-1.5.3-4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cybotrade-1.5.3-4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cybotrade-1.5.3-3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cybotrade-1.5.3-2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cybotrade-1.5.3-2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

cybotrade-1.5.3-2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

cybotrade-1.5.3-1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cybotrade-1.5.3-1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

cybotrade-1.5.3-1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cybotrade-1.5.3-1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

File details

Details for the file cybotrade-1.5.3-cp312-none-win_amd64.whl.

File metadata

  • Download URL: cybotrade-1.5.3-cp312-none-win_amd64.whl
  • Upload date:
  • Size: 13.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for cybotrade-1.5.3-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 42df596996d937fdf345dd1ace34104e9a401254758c38f1cba83c281816d7fa
MD5 9990f323b514d649504dde8fdb1b42cd
BLAKE2b-256 dff4f464cf0db44b07e5727e7ae862909ddea164ecd4d3f666d6f8872a065e5d

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 92ecc20bfc8aa5471d971497ff6ce2a6e5da90f9a727fd621bc63987743ff583
MD5 46084b56f79722c1b720d8a1341f24ab
BLAKE2b-256 92e9ecb8676f88f64eb464af663ba9e2aa1afcf84f0fd1fe650bc7bbe634f97b

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c6bd9d2ffa517a1fd669f0ecc94dd279decdd88791feee199cac35465e3086a3
MD5 b4b88d10886c3dbd44b756305f3268f4
BLAKE2b-256 71048d2b2934ac5d6b36df4084d69ecdbaf0d89e987269656aca85516a9c56e1

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96112dbc4aa7bf2f7f6ba50646527000f1bbd5f24c16f1dcf8dd34fd0a8b1b91
MD5 13885d7d3beb3defe16b75a0c054af35
BLAKE2b-256 58cc637c1fcd09088ca5083b81056eccef9335c7bb0fa87b6c14501eee448418

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-cp311-none-win_amd64.whl.

File metadata

  • Download URL: cybotrade-1.5.3-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 13.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for cybotrade-1.5.3-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 87ac28115f91ef2923bfa265123f47821d79109b68b530391a24b306ec4a4a60
MD5 6dac5b39ca32ec3651de82be812ca537
BLAKE2b-256 0f48b592ea4c9eb7037b630dc92160a09b1a94ea0dc2649365492186c9d64193

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e4859784832d5a88cf89b73c465e61876d9be78f014daa2eafc735af3d74893
MD5 d3491d72697ef1dd016be0aee7d5b277
BLAKE2b-256 8db0ac281275a402b295c193ad61d9c70efda456d6d14b58a620ecdc18c28a3e

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 01ef36c8f7ea2cda5649b71229b68bab945e80dfd5031c0835eb74e7c51d63f5
MD5 adfd2889e7e52ae32cc32db2308948b6
BLAKE2b-256 7d5511589d8d15a98188f981f879389095fa415ef25a1f1fb2efecdf539d2337

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 263e12bf54a6efba88c927960f6850574e22420dff66db24404ef2239f156c23
MD5 30d80225cd3d911ed7b8dba54f224aa0
BLAKE2b-256 7b8d464597f51898426c6af4670dc47acfc995a9aa617573ec5ab14a5c168e59

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3d69aa0205dfe4d18618c310c6d2106fb8f3e05940a1849f9b09379978835054
MD5 474cb0e8fdc428fa6aab7635d1211704
BLAKE2b-256 e70ae5d38a8307b494304e8002091b38cc5f1362e8b31f89a23baf3b28597277

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67aec50ce09216c5b69200363d98470fc716613c62a1969b21624c6f7abcb319
MD5 e5ef8d2e7acabc504cbbed788394f097
BLAKE2b-256 b71360e49995ffd0ba757adf82621d75cf6842b42f94f1801b935cd2a3ecdd57

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0781c765bedc6d71cad9d23314732eb88095f0435316c097a0a37809db928bb2
MD5 5a5c61f18674e319836ff104190db84d
BLAKE2b-256 aed21ba98616907e310ce469045869f2bf64ed9758250ac56183ce8efcc5beea

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 694deda4efd56a61a574418a1a6e5ab4509d667a6303b63897ea1ed6ad16b542
MD5 76de8fe4d011c62dfaffb9ad7b3f59f6
BLAKE2b-256 f421e79d279c2a4fd19f3e0ffd8f0220b8e865a379d42dd29c3870cbe18f1115

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 33d2304b271c3c440ce7289d14b488c967af319ab237ff17da9ead20ad68b565
MD5 186974e367ceeb7db23090cf4bc5fa02
BLAKE2b-256 4c072a58dfd32eb4e1547566a178730730df9d8558d7a5500ef20c9bfb9139ea

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b108703047d190a996859cc082f3150f025996667319bec3327574b17c0cdf6a
MD5 3206b78055003b6e7f1e89965bdfa45b
BLAKE2b-256 a7f25d1ad523649df09af00bc0bd562b90e2ba877d5351650dfe0c1b11ea06f7

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e02c65746548fd2f6f027b9812b5873c2c2c0979a2f24f4210572ca247ceccc9
MD5 5f395fbe2166a6beac5dbf364b2a0d82
BLAKE2b-256 40421fa9853157bc278a436129f4a353882daf6836992557244ce3249dc40e72

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e4df83eb03b7604fa023bff06d860c96c909f4e9cac6b9bc15c6e15257233008
MD5 08671eecc6e02fda8e444076c26db02c
BLAKE2b-256 622d68282fe91b232417db9591d8b8e10215e886ac076a0ea605340c2afcaee9

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 637e1968c7b2ce6a82af784fe5eb225ecce1d83c094d611d8d2bf7b4411d4213
MD5 fc62190c67f54436c9ba2e514eac73b6
BLAKE2b-256 42f694d60471da985f73cfab1708e0f11774635436a430e24e8721a5c621b0db

See more details on using hashes here.

File details

Details for the file cybotrade-1.5.3-1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade-1.5.3-1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 238d7f03877a5dfb47c1356bfad9ff5b5ddee715eeb6199de5786cf5f7b3b6bb
MD5 1fe651f3f5538ac9c2b38350e54879fb
BLAKE2b-256 ba527c080c1ad6f32114a8c7d065a099fd9ed83a309210771a09cd67eb04c76f

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