Using Multiple Family member accounts with the respective keys.

sanju005ind
Can I use it this way to loop through implementing same strategy across all the accounts.

import kiteconnect

# Create a list of API keys and access tokens for the 3 users
api_keys = ["YOUR_API_KEY_1", "YOUR_API_KEY_2", "YOUR_API_KEY_3"]
access_tokens = ["YOUR_ACCESS_TOKEN_1", "YOUR_ACCESS_TOKEN_2", "YOUR_ACCESS_TOKEN_3"]

# Create a single instance of KiteTicker
kite_ticker = kiteconnect.KiteTicker(api_key="YOUR_API_KEY", access_token="YOUR_ACCESS_TOKEN")

# Set the stop loss threshold and stop loss price for all users
stop_loss_threshold = 50.00
stop_loss_price = 49.50

# Define a callback function to process tick data
def on_ticks(ws, ticks):
# Loop through the list of API keys and access tokens
for api_key, access_token in zip(api_keys, access_tokens):
# Create an instance of KiteConnect for each user
kite = kiteconnect.KiteConnect(api_key=api_key, access_token=access_token)
Sign In or Register to comment.