r/algorithmictrading • • 20h ago

Quotes HELP - Getting Live Open Interest (OI) Data for NSE F&O Using Python

1 Upvotes

Hi everyone,

I'm developing a Python-based intraday trading scanner for NSE F&O stocks.

My main requirement is to fetch live Open Interest (OI) data and OI change (%) for NSE F&O stocks.

I'm looking for suggestions on:

- Is there any way to get live OI data for free?

- Does NSE provide any free API or data source?

- Can live OI and OI change be fetched using Python?

- Are there any reliable free or low-cost alternatives?

- Is it possible to get real-time OI data without purchasing an expensive market data subscription?

I'm particularly interested in solutions that can fetch OI data for multiple F&O stocks programmatically.

Any practical suggestions, API references, Python libraries or working examples would be greatly appreciated.

Thanks!


r/algorithmictrading • • 22h ago

Backtest follow up on my vol model post, comments made me run 3 more tests

Thumbnail
gallery
0 Upvotes

few people in the last thread said stuff i shouldve tested so i went and did it
first one, someone said the 0.91 correlation with vxn doesnt matter cause you trade a threshold not a forecast. so i made a plain vxn rule fire on the same 258 days as my model and compared them. only 33% of the days overlapped so my extra features did change stuff, but the days my model picked on its own were calm ones. vol after was like 19.7% vs 34% on the days only vxn fired. so its basically betting vol picks up in quiet markets and it mostly doesnt lol
full sample they lose about the same, -10.7% vs -10.9%. take out feb-jun 2020 and mine is way worse, -34.6% vs -20.4% (p 0.04). a third of its fires were in 2020. so yeah the guy who said "crash detector fitted to one crash" was right
second, another commenter found implied vol loses at 1 day in crypto. on mine the ridge did beat vxn at 1 day but only won 12 of 25 half years and was like 1% better, so a couple periods carrying it again. HAR was the worst at 1 day which is the opposite of theirs but im pretty sure thats cause im using daily returns not intraday
third, the forecasts are still decent even if they dont beat vxn so i tried using them for sizing instead. vol targeting the nasdaq at 15% vs just holding the same average amount, costs in. sharpe 0.99 vs 0.91 but the CI goes from -0.14 to +0.30 so thats not proven. drawdown was -25% vs -33% and worst month -9% vs -14.5%, and it held at every setting i tried and with each crash taken out
my rule before i ran it was 25% smaller drawdown. it came in at 24%. so it fails, not moving the bar. annoying but thats the point
funny thing is steadier risk is literally what vol targeting is for and my rule didnt even check it. should have picked rules that match what the thing actually claims to do
so no edge forecasting vol vs implied, it only looked good in 2020. sizing does what its supposed to but doesnt prove extra return
appreciate everyone who pushed on the first one, way better tests than what i had. anyone running vol targeting live, does the drawdown thing hold up after costs?