Multiple Kite Objects (Of different accounts) from the same code

arunpanjala
Dear Kite Support,

Can I initiate multiple Kite class objects of different accounts in the same code and place the orders in respective accounts?

This is what I do in the form load event of my windows App.
objKite = new KiteNet.Kite();
objKite.Api_Key = "APIKEY_Of_User1";
objKite.Api_Secret = "APISECRECT_OF_USER1";
objKite.Redirect_Url = "https://zerodha.com";
objKite.Login();


Can I do something like below with 2 subscriptions of 2 different zerodha accounts?

objKite1 = new KiteNet.Kite();
objKite2 = new KiteNet.Kite();

objKite1.Api_Key = "APIKEY_Of_User1";
objKite2.Api_Key = "APIKEY_Of_User2";

objKite1.Api_Secret = "APISECRECT_OF_USER1";
objKite2.Api_Secret = "APISECRECT_OF_USER2";

objKite1.Redirect_Url = "https://zerodha.com";
objKite2.Redirect_Url = "https://zerodha.com";

objKite1.Login();
objKite2.Login();

Please let me know if this is feasible. Thanks a lot for your help.

Regards,
Arun
  • rishiswethan
    Of course, all that matters is the kite object. Different classes can be seen as separate programs and you can have a master class that calls a function in the separate account's class objects with different ids
  • arunpanjala
    arunpanjala edited September 2019
    Thanks for your response. I tried this in Upstox API. For some reasons it was sticking to the access codes of the first logged in user no matter how I try.

    @HowUTrade Please confirm
  • HowUTrade
    @arunpanjala

    User settings and properties are stored at application level per installation(application folder).
    So you can't initialize two Kite object in same process.

    Just make a copy of your application folder, and run your app as two separate process with separate Kite object.
Sign In or Register to comment.