not receiving live ticks

ajy
ajy edited April 2018 in Market data (WebSockets)
hi my user id is xxx. i have subscribed for kiteconnect as well as historical data. i am using kiteticker example but not receiving any live quotes.
  • ajy
    ajy edited April 2018
    here is the code.
     var ticker = new KiteTicker({
    api_key: api_key,
    access_token: access_token,
    public_token: public_token,
    });

    // ticker = new KiteTicker("xxxx", "xxxx", "xxxxx");
    ticker.on("tick", setTick);
    ticker.on("connect", subscribe);
    ticker.on("order_update", orderUpdate);

    function subscribe() {
    // var subscribe = Object.keys(items).map(function(val) { return parseInt(val) });
    var subscribe = [53359623]
    ticker.subscribe(subscribe);
    ticker.setMode(ticker.modeFull, subscribe);
    }

    function setTick(ticks) {
    ticks.forEach(function(tick) {
    console.log("tick", tick)
    })
    }
  • sujith
    Please don't reveal your account related keys on a public thread. You can private message if you need to write account related stuff.

    You are not calling connect and hence it is not working.
    You can check out the example here.
  • ajy
    i had just posted part of the code. but i figured the problem was I should have subscribed to the event with "ticks" and not "tick". ticker.on("ticks",cb) as opposed to ticker.on("tick",cb). I will try this in tommorows market. appreciate your prompt reply. thnx
Sign In or Register to comment.