Skip to main content

LT Kline

Subscribe to the leveraged token kline stream.

tip

If confirm=true, this means that the candle has closed. Otherwise, the candle is still open and updating.

Available intervals:

  • 1 3 5 15 30 (min)
  • 60 120 240 360 720 (min)
  • D (day)
  • W (week)
  • M (month)

Push frequency: 1-60s

Topic:
kline_lt.{interval}.{symbol} e.g., kline_lt.30.BTC3SUSDT

Response Parameters

ParameterTypeComments
topicstringTopic name
typestringData type. snapshot
tsnumberThe timestamp (ms) that the system generates the data
dataarrayObject
> startnumberThe start timestamp (ms)
> endnumberThe end timestamp (ms). It is current timestamp if it does not reach to the end time of candle
> intervalstringKline interval
> openstringOpen price
> closestringClose price
> highstringHighest price
> lowstringLowest price
> confirmbooleanWeather the tick is ended or not
> timestampnumberThe timestamp (ms) of the last matched order in the candle

Subscribe Example

from pybit.unified_trading import WebSocket
from time import sleep
ws = WebSocket(
testnet=True,
channel_type="spot",
)
def handle_message(message):
print(message)
ws.lt_kline_stream(
interval=30,
symbol="EOS3LUSDT",
callback=handle_message
)
while True:
sleep(1)

Response Example

{
"type": "snapshot",
"topic": "kline_lt.5.EOS3LUSDT",
"data": [
{
"start": 1672325100000,
"end": 1672325399999,
"interval": "5",
"open": "0.416039541212402799",
"close": "0.41477848043290448",
"high": "0.416039541212402799",
"low": "0.409734237314911206",
"confirm": false,
"timestamp": 1672325322393
}
],
"ts": 1672325322393
}