It looks like you're new here. If you want to get involved, click one of these buttons!
var ticker = new KiteTicker({
api_key: apiKey,
access_token: accessToken,
});
// set autoreconnect with 10 maximum reconnections and 5 second interval
ticker.autoReconnect(true, 10, 5)
ticker.connect();
ticker.on("ticks", onTicks);
ticker.on("connect", subscribe);
ticker.on("noreconnect", function() {
console.log("noreconnect");
});
ticker.on("reconnect", function(reconnect_count, reconnect_interval) {
console.log("Reconnecting: attempt - ", reconnect_count, " interval - ", reconnect_interval);
});
function onTicks(ticks) {
console.log("Ticks", ticks);
}
function subscribe() {
var items = [738561];
ticker.subscribe(items);
ticker.setMode(ticker.modeFull, items);
}