Tick Data Not Getting

bhumi
Hi,
I have made connection from;
var ticker = new KiteTicker("", "", "");

after that following code has been used to show the Tick:

ticker.connect();
ticker.on("tick", onTick);
ticker.on("connect", onConnect);
function onTick(ticks) {
alert('OKKK');
console.log("Ticks", ticks);
}
function onConnect() {
ticker.subscribe([738561]);
ticker.setMode(ticker.modeFull, [738561]);
}

But not getting the ticks, please suggest.
  • Shivdas
    I think you should have to use following code
    And probably it will help you

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

    ticker.connect();
    ticker.on("ticks", onTicks);
    ticker.on("connect", subscribe);

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

    function subscribe() {
    var items = [738561];
    ticker.subscribe(items);
    ticker.setMode(ticker.modeFull, items);
    }
  • bhumi
    I got issue related to the WebSocket "failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED".

    How can I make successful connection with this?
  • rakeshr
    Hi @bhumi
    Make sure you are on latest Kite connect client.
  • bhumi
    @rakeshr I am using the code; which is given here

    https://gist.github.com/ajinasokan/b36d17da1a58af62782978c16bca309a

    Is this old code? If yes then kindly provide the latest code.
  • rakeshr
    @bhumi ,I'm talking about Kite Connect API Javascript client version, it should be latest, version 3.
    You can check version of kiteconnect JS client by npm list --depth=0, it should be [email protected], if not ,then try installing latest version by npm install kiteconnect@beta.
Sign In or Register to comment.