It looks like you're new here. If you want to get involved, click one of these buttons!
def on_ticks(ws, ticks):
#define my logic here
def on_connect(ws, response):
ws.subscribe(token)
ws.set_mode(ws.MODE_FULL, token)
kws.on_ticks = on_ticks
kws.on_connect = on_connect
kws.connect(threaded=True)
while True:
for i in exceldata.index:
ws.subscribe(exceldata.at[i,'instrumentid'])
ws.set_mode(ws.MODE_FULL, at[i,'instrumentid'])
Kindly suggest how I can do this in an efficient manner or any other alternative approach that would be useful here.
If you give more clarity on why you need multiple threads we might be able to suggest other options, also incase if you are tech savy you can put up those(each) threads through different ISP/internet using dispatch proxy.
mostly computation wont be an issue in local system, your NIC cache,handling socket data wil be a challange ..
API trading will be simple is we stick to simple "Computational signal generation" instead of Algo strategies.
Every row of my excel file has the instrument ids and contract names of two stocks.Additionally,there are a fixed set of parameters and their values will vary for every row.I want to loop through the rows of this excel and create a separate thread for every row,so that every threads shows the tick data of two instruments,does some calculations on the basis of the parameters and sends orders.