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.
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.
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
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.
{
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;
}
}