It looks like you're new here. If you want to get involved, click one of these buttons!
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);
});
},
If you have subscribed to full mode then you will receive ticks when there is a change in one of the bids or offers.