Get NIFTY tick data

zerotoinfinite2006
I am trying to use the following code to get the tick data for NIFTY (as per the documentation but on connect I am getting error 400

in Main function:
// Collect tokens and user details using the request token
User user = kite.GenerateSession(MyRequestToken, MySecret);

// Persist these tokens in database or settings
string MyAccessToken = user.AccessToken;
string MyPublicToken = user.PublicToken;
initTicker();


private static void initTicker()
{
ticker = new Ticker(MyAPIKey, MyAccessToken);

ticker.OnTick += OnTick;
ticker.OnReconnect += OnReconnect;
ticker.OnNoReconnect += OnNoReconnect;
ticker.OnError += OnError;
ticker.OnClose += OnClose;
ticker.OnConnect += OnConnect;
ticker.OnOrderUpdate += OnOrderUpdate;

ticker.EnableReconnect(Interval: 5, Retries: 50);


// Subscribing to NIFTY50 and setting mode to LTP
ticker.Subscribe(Tokens: new UInt32[] { 260105 });
ticker.SetMode(Tokens: new UInt32[] { 260105 }, Mode: Constants.MODE_LTP);
ticker.Connect(); // Error in this line Error 400
}

I have used the same sample code from the examples and I am able to get Access tokens and public token successfully. Is there any code example to show how can I get tick data for NIFTY
Sign In or Register to comment.