Python 文档
Candles

Candles

Candle data can be accessed through the Runtime through the candle_topics parameter in RuntimeConfig.

A topic in cybotrade refers to a unique referencing string that correlates to a particular candle or datasource topic.

Candle topic(s) are set with the following format

candles-{interval}-{base asset}/{quote asset}-{exchange}

Intervals

The currently available intervals are as such:

1m, 3m, 5m, 15m, 30m,
1h, 2h, 4h, 8h, 12h,
1d, 3d, 1w, 1M

Exchange Support

The table below shows the currently supported exchanges.

Order Placement & API refers to the capability to interact with said Exchange (market) through the Cybotrade runtime.
Candle Data refers to the capability to retrieve candle data through Cybotrade.

ExchangeOrder Placement & APICandle Data
Bitget (linear)
Bybit (linear)
Binance (linear)
Okx (linear)
Zoomex (linear)
Bitget (spot)
Bybit (spot)
Binance (spot)
Okx (spot)
Zoomex (spot)

Setting topics in the RuntimeConfig

Below are examples of how to format a linear candle topic:

"candles-5m-BTC/USDT-bybit"
"candles-1m-ETH/USDT-binance"
"candles-12h-AVAX/USDT-bitget"

While formating spot candle topic(s) comes with a minor difference:

"candles-5m-BTC/USDT-bybit_spot"
"candles-1m-ETH/USDT-binance_spot"
"candles-12h-AVAX/USDT-bitget_spot"

In order to use these topics, you can insert the desired topic into the candle_topics parameter of the RuntimeConfig like such:

config = RuntimeConfig(
    candle_topics=[
        "candles-1m-ETH/USDT-bybit",
        "candles-1d-BTC/USDT-bybit_spot",
        "candles-12h-AVAX/USDT-binance"
    ],
    ...
)