Ticker Behavior Confirmation

rsiddhartht
Hello,

Wanted to confirm the behavior of the .NET client, and the way it subscribes to ticks for an instrument. I am interested in getting the LTP for an instrument and to achieve the same, have followed the example given here: https://github.com/zerodhatech/dotnetkiteconnect

Now, the OnTick() is called every second even though the LTP has not changed (Screenshot attached):


Which actually contradicts the logic mentioned here: https://kite.trade/forum/discussion/1291/frequency-of-ticks

Can you please confirm the said behavior? I'm interested in getting unique LTP callbacks.
Log.png 77.7K
  • sujith
    If you subscribe for tick in modeFULL then you will receive ticks for every change in the depth also. You need to set the mode to modeLTP for listening to only LTP changes.
  • rsiddhartht
    rsiddhartht edited December 2018
    @sujith Yes, I am subscribing to just LTP. Below code for your reference:

    var testToken = new uint[]
    {
    13406210
    };
    _ticker.Subscribe(Tokens: testToken);
    _ticker.SetMode(Tokens: testToken, Mode: Constants.MODE_LTP);
  • sujith
    Can you paste the complete code which can reporduce this issue?
  • rsiddhartht
    rsiddhartht edited December 2018
    @sujith please find below a snippet to reproduce the issue.
    internal class Program
    {
    private static void Main(string[] args)
    {
    var user = new Kite(configuration["Kites:ApiKey"]).GenerateSession(configuration["Kites:RequestToken"],
    configuration["Kites:ApiSecret"]);
    var ticker = new Ticker(configuration["Kites:ApiKey"], user.AccessToken);
    ticker.EnableReconnect(Interval: 5, Retries: 50);

    ticker.OnTick += Ticker_OnTick;
    ticker.Connect();

    var testToken = new uint[]
    {
    13406210
    };

    ticker.Subscribe(Tokens: testToken);
    ticker.SetMode(Tokens: testToken, Mode: Constants.MODE_LTP);

    Console.ReadKey()
    }

    private void Ticker_OnTick(Tick tickData)
    {
    Console.WriteLine($"{tickData.InstrumentToken}, {tickData.LastPrice}, {DateTime.Now}");
    }
    }
  • rsiddhartht
    @sujith any updates on this?
  • tonystark
    We tried above code and it seems to be working fine.
  • rsiddhartht
    rsiddhartht edited December 2018
    @tonystark or @sujith are you sure its working fine; coz I tested the sample code again today and I'm getting duplicate LTP's:


  • tonystark
    It seems we missed something while testing your code. We are able to reproduce this now. Our backend team is checking this behavior. We will get back to you with a confirmation.
  • rsiddhartht
    Any updates on this?
  • rsiddhartht
    rsiddhartht edited January 2
    @sujith or @tonystark
    Any update on this issue? I checked today and its still happening. Can you please get a quick resolution to this issue?
  • sujith
    We have informed the team, they are working on it.
  • rsiddhartht
    @sujith thanks for the update. Any ETA on this?
  • RajeshSivadasan
    RajeshSivadasan edited January 7
    Hi @sujith or @tonystark ,
    I require FULL mode data except market depth and require only when ltp changes. How do I do that? I am using python.
  • sujith
    Kite Ticker provides data in only three modes, modeLTP, modeQUOTE and modeFULL.
    It doesn't have a feature to fetch only partial fields. This feature something we have plans of providing in the future if it is feasible at our end.
    You can subscribe to any mode and ignore the fields that are not needed as of now.
This discussion has been closed.