Ticks received on Kite API for nifty jun fututres are not matching with what is shown on kite web

bhadra
I have subscribed for OnTick event on ticker class and from past 15 days what ticks I receive from kite API always lags 10-15 points from what is shown on kite web.

private void OnTick(Tick tickData)
{
tickData.LastPrice
}

this "tickData.LastPrice", is always 10-20 points different from what is shown on kite web during morning hours.
  • bhadra
    .Net 4.7.2 version and kite connect is 3.0.3.0. It was working fine from past one and half years and now I am facing this issue.
  • sujith
    Is this consistent or intermittent? How many tokens have you subscribed to? What are you doing in onTick?
  • sujith
    Are you doing some kind of calculation or dumping to the database?
  • bhadra
    bhadra edited June 2021
    It is very consistent. I have subscribed to only 1 token. That is Nify Jun futures-12418050. I am not doing any calculation or dumping to database. It was working fine from past 1 and half years. I just check tickData.LastPrice to trigger buy options. Simple if and else statements are there. Today, my short trigger was at 15580. But, tick received was 15661. I am receiving ticks continuously. There is no blocking. But, all inconsistent values.
  • bhadra
    bhadra edited June 2021
    I have logged ticks received as it is in this file for 2 mins on 17 Jun. There was 20 points difference between what is shown in kite web and API ticker
  • bhadra
    private void InitTicker()
    {
    myTicker = new Ticker(MyAPIKey, MyAccessToken);
    myTicker.OnTick += OnTick;
    }

    private void OnTick(Tick tickData)
    {
    switch (Task)
    {
    case Mode.Buy:
    if (NoOpenPosition)
    {
    if(tickData.LastPrice > "myLevel" || tickData.LastPrice < "myLevel")
    BuyOptions()
    }
    break;

    case Mode.Sell:
    if(tickData.LastPrice < "myLevel" || tickData.LastPrice > "myLevel")
    {
    squreOffPosition()
    }
    break;
    }
    }
  • bhadra
    bhadra edited June 2021
    LastPrice I receive throught ticker object is not real time value. Especially during morning hours. Today at 10:00:21, nifty broke 15580. But, LastPrice I received was 15661.
  • sujith
    Can you remove all the code and just put print statements with time and price?
Sign In or Register to comment.