(20241226) With new bash scripts for SocketIO.

This commit is contained in:
2024-12-27 19:27:22 +05:30
parent 61777d7f05
commit 93a68cc078
4 changed files with 34 additions and 8 deletions
+10 -8
View File
@@ -185,6 +185,7 @@ def main():
# Get the instruments of interest:
response = httpx.post(url = r"https://api.thecaoffice.com/markets/watchlist/distincts")
instruments_of_interest = response.json()["data"]["rs0"]
print("TOTAL INSTR. OF INTEREST:", len(instruments_of_interest))
symbols_of_interest = [i["symbol"] for i in instruments_of_interest]
# Create an instance of Zerodha's Kite connection:
@@ -192,17 +193,18 @@ def main():
kite.set_access_token(access_token)
# Get the entire list of instruments:
instruments = kite.instruments(exchange = "NSE")
instruments += kite.instruments(exchange = "NFO")
instruments += kite.instruments(exchange = "BSE")
instruments += kite.instruments(exchange = "BFO")
instruments = []
# instruments += kite.instruments(exchange = "NSE")
# instruments += kite.instruments(exchange = "NFO")
# instruments += kite.instruments(exchange = "BSE")
# instruments += kite.instruments(exchange = "BFO")
instruments += kite.instruments(exchange = "MCX")
instruments += kite.instruments(exchange = "CDS")
instruments += kite.instruments(exchange = "BCD")
# instruments += kite.instruments(exchange = "CDS")
# instruments += kite.instruments(exchange = "BCD")
# # Pick the instruments of interest:
# instruments = [TradingSymbol.from_zerodha_kite(i) for i in instruments[:1000]]
instruments = [TradingSymbol.from_zerodha_kite(i) for i in instruments if i["tradingsymbol"] in symbols_of_interest]
instruments = [TradingSymbol.from_zerodha_kite(i) for i in instruments[:1000]]
# instruments = [TradingSymbol.from_zerodha_kite(i) for i in instruments if i["tradingsymbol"] in symbols_of_interest]
# Create the lookup:
for i in instruments: