acess_token="XXXXXXXXXXXXX"
token_list = {"action": "subscribe", "key": ["feed","ack"], "value": [""]}
feed = {"action": "feed", "key": ["full"], "value": ["NC20000"]}
#unsubscribefeed = {"action":"unsubscribe","key":["feed"],"value":[""]}
ack= {"action": "ack", "key": [""], "value": [customer number]}
sws = SharekhanWebSocket(access_token)
def on_data(wsapp, message):
data = json.loads(message)
def on_open(wsapp):
print("on open")
sws.subscribe(token_list)
sws.fetchData(feed)
sws.fetchData(ack)
# sws.unsubscribe(unsubscribefeed)
#sws.close_connection()
def on_error(wsapp, error):
print(error)
def on_close(wsapp):
print("Close")
Assign the callbacks.
sws.on_open = on_open
sws.on_data = on_data
sws.on_error = on_error
sws.on_close = on_close
sws.connect()
can anyone help me to use ack module and what response we can expect , i got feed module sorted and getting data for token "NC20000" but not getting response for ack , i tried to create a buy sell trade limit order, but got no response in console ,
acess_token="XXXXXXXXXXXXX"
token_list = {"action": "subscribe", "key": ["feed","ack"], "value": [""]}
feed = {"action": "feed", "key": ["full"], "value": ["NC20000"]}
#unsubscribefeed = {"action":"unsubscribe","key":["feed"],"value":[""]}
ack= {"action": "ack", "key": [""], "value": [customer number]}
sws = SharekhanWebSocket(access_token)
def on_data(wsapp, message):
data = json.loads(message)
def on_open(wsapp):
print("on open")
sws.subscribe(token_list)
sws.fetchData(feed)
sws.fetchData(ack)
def on_error(wsapp, error):
print(error)
def on_close(wsapp):
print("Close")
Assign the callbacks.
sws.on_open = on_open
sws.on_data = on_data
sws.on_error = on_error
sws.on_close = on_close
sws.connect()
can anyone help me to use ack module and what response we can expect , i got feed module sorted and getting data for token "NC20000" but not getting response for ack , i tried to create a buy sell trade limit order, but got no response in console ,