Getting OHLC Data for a specific time

Hello Everyone, I wish to create a code that fetches the OHLC data for a specific time. For example 26 Nov 2023, 13:30:00

Current documentation doesn’t provide any possibilities for this. Anything that can be done here? @PravinJ @Tradehull_Imran @Tradehull @Naman @Dhan

Hi @Lowkey_1999

you can use below code

import pdb
import time
import datetime
import traceback
from Dhan_Tradehull_V2 import Tradehull
import pandas as pd
from pprint import pprint
import talib


client_code = "client_code"
token_id    = "token_id"
tsl = Tradehull(client_code,token_id)

options_data = tsl.get_historical_data(tradingsymbol = 'NIFTY 28 NOV 24000 CALL',exchange = 'NFO',timeframe="5")
ohlc_data    = options_data.loc[options_data['timestamp'] == '2024-11-27 12:20:00+05:30']

1 Like


This is where I am stuck @Tradehull_Imran @Tradehull

What could be the parameter issue?