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:
- 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
- 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?