Latency Issues in F&O Data Feed

I was backtesting a strategy in 5 min F&O charts . The condition was to enter if the price was above 200 MA. It’s working fine for Equity scrips. But with F&O, the entry doesn’t seems to match when I manually checked the charts. There seems to be some issues with the F&O datafeed. The indicator values are being thrown off by a large range.

Hi @shakthi_jagdish,

Kindly help us by providing the specific instances of where you have faced this issue.

Example: kindly give us the F&O scrip name(s), the date(s) for which you have run the backtesting, the indicator(s) used, and some specific time instance(s) where the values did not match the charts.

Let us take this forward and drive it to closure.

` aki

The instrument name is BANKNIFTY2131834300PE (Banknifty 18 Mar 2021 34300 PE); Backtesting period - 8 March 9: 15 to 16 March 15:30. The point is to buy when previous candle close is above 20 MA which in turn is above 50 MA and all of them are above 200 MA (close[-1] > 20 MA > 50 MA > 200 MA). At the time of entry (12 March, 14:25), the you can clearly see that condition is not meeting. It can happen if not all data isn’t loaded or if limited data is loaded. I have faced this issue when using Tradingview chart in upstox for which I’ll have to refresh multiple times. For equities, my automated entry is matching with my manual check. I have this issue only with F&O.

I also found that 200 MA value till 9th March 14:10 is nan and other MA values aren’t properly updated whereas I could see in my broker charting platform the data is proper. Also, for the initial few candles, there isn’t any historical data. I’ve attached screenshots comparing the logs with my chart. The RSI value seems to be somewhat without any problem.

Hi @shakthi_jagdish,

The team is looking into this.

I will revert with a resolution or ask you in case of any queries.

` aki

Hi @shakthi_jagdish,

I have an update on this issue.

For python builds (pyalgotrading package), backtesting is supported only for the current week.

Current week here means: Friday to Thursday.


If today is 30-MAR-2021, then the current week is 26-MAR-2021 (Friday) to 01-APR-2021 (Thursday).

Also note: The Call/Put instrument that you choose for backtesting for the current week, “should not” be already expired.

Kindly match the data after doing this and let me know if the data mismatch issue still persists.

Let us take it forward and drive it to closure.

` aki