Skip to main content

Acknowledgement feed

Websocket Acknowledgment Feed provides us the connection status of the websockets.

Request Details

ParameterDescription
t't' 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_feed('NSE|26000#NSE|26009#NSE|22')

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

ws.connect(uid="<userId>", actid="<userId>")
ws.run_forever()

Subscription TouchLine Acknowledgement

ParameterDescription
trepresents feed 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
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

Sample response

{
't': 'tf',
'e': 'NFO',
'tk': '',
'pp': '',
'ts': '',
'ti': '',
'ls': '',
'lp': '',
'pc': '',
'v': '',
'o': '',
'h': '',
'l': '',
'c': '',
'ap': '',
'oi': '',
'poi': '',
'toi': '',
'bq1': '',
'bp1': '',
'sq1': '',
'sp1': '',
'ft': '',
}