Not receiving any data through KiteTicker API

rajeshkolagatla
HI Zerodha,

I have installed the NODEJS KiteConnect module and when I execute the following code during MARKET HOURS I am not receiving any tick data. Could someone please help me out:
Code:
var KiteTicker = require("kiteconnect").KiteTicker;
console.log('Successfully imported module');
var ticker = new KiteTicker({
api_key: "<>",
access_token: "<>"
});

try {
ticker.connect();
console.log('Called ticker.connect');
ticker.on("ticks", onTicks);
ticker.on("connect", subscribe);

function onTicks(ticks) {
console.log("Ticks", ticks);
}

function subscribe() {
var items = [408065];
ticker.subscribe(items);
ticker.setMode(ticker.modeFull, items);
}
} catch (err) {
console.log(err);
}
It is neither throwing any error nor giving tick data.

Thanks,
Rajesh
  • sujith
    Try setting on_error callback, you can see error messages in that.
Sign In or Register to comment.