Is it possible to get 1min OHLC data from MarketFeed API

I tried fetching MarketFeed data but OHCL data is not changing and seems this API returns data for daily candle. Is there any other way to get live OHLC data?

Hi @vbhaya

check this codebase, it has many pre-built functions for calling data.

https://www.youtube.com/watch?v=_CShlk2zYkQ&t=299s

thanks @Tradehull_Imran,
I tried API dhan.ohlc_data in a loop but here also i dont see OHLC data is getting updated

data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25976.9, ‘ohlc’: {‘open’: 0, ‘close’: 25976.9, ‘high’: 0, ‘low’: 0}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25960, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25950}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25932.3, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25928}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25931.8, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25928}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25916, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25912}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25922, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25903.6}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25940.8, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25903.6}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25939.4, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25903.6}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25940.4, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25903.6}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25946.1, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25903.6}}}}”
status,success,success
,status,remarks,data
data,success,“{‘NSE_FNO’: {‘52168’: {‘last_price’: 25950, ‘ohlc’: {‘open’: 25980.2, ‘close’: 25976.9, ‘high’: 25999, ‘low’: 25903.6}}}}”

Hi @vbhaya ,

The ohlc_data API gives daily candle data:

  • Open stays the same all day
  • High and Low change only if a new high or low is made
  • Close is yesterday’s close, so it doesn’t change
  • Only LTP keeps updating

For live candles, use the historical data API.

data  = tsl.get_historical_data(tradingsymbol = 'NIFTY',exchange = 'INDEX' ,timeframe="1")