Optimizing Data Fetching for 5-Minute Nifty Options Strategy

I’m running an automated trading strategy on the Nifty options 5-minute timeframe, and I need help optimizing my data retrieval process. Here’s how it works:

  1. Every 5 minutes, the bot:
  • Fetches the Nifty spot price
  • Identifies ATM-5 to ATM+5 strikes for both CE & PE
  • Collects 5-minute OHLCVOI data for these strikes
  • Uses last 5 days of historical data for decision-making
  1. Current Bottleneck:
  • Using REST API (Python requests), the entire process (data fetch + computation + order entry) takes ~30 seconds
  • Since I’m working on a 5-minute window, this delay is significant

What’s the most efficient way to speed this up?

1 Like

shayad websocket ke data ko append karke hi possible else immpossible hai

but aggregating tick data for multiple instruments is quite complicated and the latency again takes a hit.

wo to hai magar iske alawa koi bhi upaya nai hai jahan tak meri samajh hai tumhare teen websocket connect hai waise free

kya aap mujhe ek cheez bata sakte ho ki kya upar data jo apne fetch kiya wo easy raha apke liye mereko bohot issue aya and websocket karne m to pasina nikal gaaya

its very tough i always mess up with v2 and v3, i think it is better if we have a discussion at 4 pm call today to understand api reality