Why everyone is asking for migration in forum?
parth3737
@parth3737
Best posts made by parth3737
Latest posts made by parth3737
-
RE: Migrate my code in Smart API
-
Websocket Data Issue
Hello,
Is the below code correct? As I am not getting tick data for SBI.
Can someone help?token="mcx_fo|224395"
token="nse_cm|3045" #SAMPLE: nse_cm|2885&nse_cm|1594&nse_cm|11536&nse_cm|3045token="mcx_fo|226745&mcx_fo|220822&mcx_fo|227182&mcx_fo|221599"
task="mw" # mw|sfi|dpss = SmartWebSocket(feedToken, clientId)
def on_message(ws, message):
print("Ticks: {}".format(message))
print(message)
def on_open(ws,response):
print("on open")
ws.subscribe(task,token)def on_error(ws, error):
print(error)def on_close(ws):
print("Close")
ws.stop()ss._on_open = on_open
ss._on_message = on_message
ss._on_error = on_error
ss._on_close = on_closess.connect()
Output is below:
[{'name': 'tm', 'tvalue': '02/07/2021 20:03:04'}]
Ticks: [{'name': 'tm', 'tvalue': '02/07/2021 20:03:05'}]
[{'name': 'tm', 'tvalue': '02/07/2021 20:03:05'}]
Ticks: [{'name': 'tm', 'tvalue': '02/07/2021 20:03:06'}]
[{'name': 'tm', 'tvalue': '02/07/2021 20:03:06'}]