I want to run my own strategy in automation. I have my pine script ready but tradingview doesn’t support hedged positions for backtesting. So I decided to run backtest using python. That also I created. But I am stopped by availability of historical data. I need Natural Gas Futures & options OHLC data for 5 years in 15 minute time frame. Dhan provided 15 min futures data for 3 months but that is not enough. Can anybody guide me how to get 5 years futures & options data ? Without backtest I may not be able to deploy my strategies on dhan platform. Kindly guide me.
Hi @Niranjan ,
The futures data is provided as continuous contracts and not contract-wise. If you use near-expiry contracts, you will get full daily timeframe data from when the respective contract started trading; however, intraday data (such as 15-minute) is available only for the currently active contract and not for older ones.
Additionally, expired MCX options data is not available, so retrieving historical options OHLC for past contracts is not possible.
Due to data size constraints, only up to 90 days of intraday data can be fetched in a single request for any timeframe. If you require long-term intraday datasets (such as 5 years), you will need to continuously store the data at your end for ongoing analysis, as historical intraday data beyond the active contract is not available.
For any further queries, please write us back on - apihelp@dhan.co