Quote API returns same OHLC in all the calls

kamleshNB
Quote API returns same OHLC in all the calls, can some one help?
  • sujith
    You can check out documentation. It returns day data and not intraday OHLC.
  • kamleshNB
    What do I have to use if I need intraday OHLC? WebSocket?
  • ajy
    ajy edited April 2018
    Kiteticker class. Websockets already built in it. Just use kiteticker.subscribe(instrument list) then kiteticker.on('tick', cb)
  • sujith
    For backtesting, you can use historical data API. For live strategies, I would suggest generating candles at your end using the websocket live market data.
  • kamleshNB
    I'm building swift client, Thanks it worked
  • kamleshNB
    @sujith same thing is happening with WebSocket, I am getting same OHLC every time. I am using "full" mode.
  • sujith
    You need to build candles at your end using live market data received from websockets. You can check out this thread to get started.
  • sujith
    OHLC in full mode is day's OHLC data and not a minute or hour OHLC.
  • kamleshNB
    @sujith Tried using "quote" mode, but still I'm getting same ohlc every minute.
  • kamleshNB
    @sujith I've also noticed that I receive multiple streams every minute as onmessage fires multiple times
  • sujith
    Yes, you get tick data whenever there is a change in the data.
    You need to use on_ticks callback to listen to ticks(live market data).
  • sujith
    on_message is a raw callback for data. Kite Connect already does all the processing and give you back data on on_ticks callback and on_order_update.
  • kamleshNB
    @sujith Got it, but, how come it sends same data for over 10 minutes, it was fluctuating on Kite App but not via WebSocket.
  • sujith
    Kite also uses the same API maybe only marketdepth was changing.
    Kite Ticker only sends tick when there is a change in data.
  • sujith
    You mean OHLC? OHLC is day's data it won't change for every tick. It will only change when there is an LTP more than high or LTP which is lesser than low of the day.
    Open and close are anyways fixed.
  • kamleshNB
    @sujith What mode should I use in order to build Candle at specific interval? Is it "ltp"? that I should use.
  • sujith
    Yes, you can just subscribe for data in modeLTP and generate candles using that.
  • kamleshNB
    @sujith Thanks for your help, it worked. One thing I noticed, some times I receive just from the WebSocket, total bytes recd are 12, but when I read firt 2 bytes to get number of packets it return huge number. I am not using official Clients, developing my own to work with iOS.
  • sujith
    Are you using big-endian or little-endian?
    Are you comfortable with any other technology other than Objective-C or swift?
    You can check out any of the client libraries to know more about parsing binary data.
Sign In or Register to comment.