Getting wrong ohlc data

ImpulsivePuffin
ImpulsivePuffin edited August 2020 in Python client
I'm getting the ohlc data using websocket. same ohlc values are repeatedly coming as tick data and these values are completely different from the current market price for the stock.

eg of BHARTIARTL:

2020-08-13T12:35:24+00:00
{'open': 534.0, 'high': 548.3, 'low': 524.25, 'close': 547.7}
-2020-08-13T12:35:24+00:00
{'open': 534.0, 'high': 548.3, 'low': 524.25, 'close': 547.7}
2020-08-13T12:35:26+00:00
{'open': 534.0, 'high': 548.3, 'low': 524.25, 'close': 547.7}

snippet that was used to generate above output

print(item["last_trade_time"])
print(item["ohlc"])
Tagged:
  • sujith
    This is BHARTIARTL, NSE instruments OHLC. What is the issue here? It seems fine.
  • ImpulsivePuffin
    ImpulsivePuffin edited August 2020
    @sujith yes, this does not match market tick data for the ltt mentioned. eg: 524 is the day's low, not for that tick. and the same data is repeatedly coming as tick data
  • sujith
    The Websocket data will give you day's OHLC. You can know more here.
  • ImpulsivePuffin
    ImpulsivePuffin edited August 2020
    @sujith ,Thanks for clarifying . I was under the impression that the ohlc received is for the current tick and creating candles from that . I will create the candles from last traded price and last traded quantity (for volume data of the interval)
  • sujith
    This thread could be helpful to get started.
Sign In or Register to comment.