Tick data returns several times even if there is no change

DM2290
Dear @sujith and team,

I am using the following code to retrieve the tick data for a subscribed token. However even though there is no change in LTP, the ticker returns data. In previous threads and documentation, I have read that the tick data is supposed to return only when there is a change. Kindly clarify.

const KiteTicker = require("kiteconnect").KiteTicker;
var ticker = new KiteTicker({
api_key: global.apiKey,
access_token: global.accessToken,
});

ticker.autoReconnect(true, 10, 5);
ticker.connect();
ticker.on("connect", on_connect);
ticker.on("ticks", this.on_ticks);

function on_connect() {
ticker.setMode(ticker.modeLTP, global.tokenSubscriptionList);
}

on_ticks: async function(ticks) {
ticks.forEach((tokenArray) => {
console.log("instrument token: " + ticks[0].instrument_token + " last price is: " + ticks[0].last_price);
});
},
Tagged:
  • sujith
    You will receive ticks when there is a change in any of the values you have subscribed to, not only for LTP.
    If you have subscribed to full mode then you will receive ticks when there is a change in one of the bids or offers.
Sign In or Register to comment.