Skip to main content

Acknowledgement depth

Depth acknowledgement

The WebSocket Depth Acknowledgement API ensures that the WebSocket connection to the server is monitored and its status is regularly reported.

Request detailsā€‹

ParameterDescription
tā€˜dā€™ represents touchline task
kOne or more scriplist for subscription. Example NSE 22#BSE
from typing import Any
from thefirstock.firstockModules import firstockWebSockets
from thefirstock.pyClient.websocket import WsClient
from thefirstock.pyClient.websocket.enums import MessageTopic


client = firstockWebSockets.webSocketLogin()
ws = client.ws

@ws.on_connect
def connected(client, message):
if message.get('s') == 'OK':
client.subscribe_depth('NSE', '26000')


@ws.on_message(MessageTopic.DEPTH_SUB_ACK)
def msg_handler(client: WsClient, message: Any):
print(message)


ws.connect(uid='userId', actid='userId')
ws.run_forever()

Subscription Depth Acknowledgementā€‹

ParameterDescription
t't' represents touchline acknowledgement
eNSE, BSE, NFO ..Exchane name
lpLTP
tk22 Script token
ppPrice precision
tsTrading Symbol
tiTick size
lsLot size
lpLTP
pcPercentage change
vvolume
oOpen price
hHigh price
lLow price
cClose price
apAverage trade Price
lttLast trade time
oiOpen interest
poiPrevious day closing Open Interest
toiTotal open interest for underlying
bq1Best Buy Quantity 1
bp1Best Buy Price 1
sq1Best Sell Quantity 1
sp1Best Sell Price 1
ftFeed time
bq2Best Buy Quantity 2
bq3Best Buy Quantity 3
bq4Best Buy Quantity 4
bq5Best Buy Quantity 5
bp2Best Buy Price 2
bp3Best Buy Price 3
bp4Best Buy Price 4
bp5Best Buy Price 5
bo1Best Buy Orders 1
bo2Best Buy Orders 2
bo3Best Buy Orders 3
bo4Best Buy Orders 4
bo5Best Buy Orders 5
sq2Best Sell Quantity 2
sq3Best Sell Quantity 3
sq4Best Sell Quantity 4
sq5Best Sell Quantity 5
sp1Best Sell Price 1
sp2Best Sell Price 2
sp3Best Sell Price 3
sp4Best Sell Price 4
sp5Best Sell Price 5
so1Best Sell Orders 1
so2Best Sell Orders 2
so3Best Sell Orders 3
so4Best Sell Orders 4
so5Best Sell Orders 5
lcLower Circuit Limit
ucUpper Circuit Limit
52h52 week high low in other exchanges, Life time high low in mcx
52l52 week high low in other exchanges, Life time high low in mcx