Hi Nocholas,
I looked at your strategy — the idea of using self.History to pull historical volume data and taking average should work fine.
But, as the strategy defines `TwentyDayATR` at every OnData call, it will always be not ready. So, OnData would always return after these lines of code.
TwentyDayATR = self.ATR("KEYS", 20, MovingAverageType.Simple, Resolution.Daily)
if not TwentyDayATR.IsReady:
return
Indicators that are created using helper methods, like self.ATR in this case, should be defined only once (preferably in Initialize). Please check out this documentation section for more details of using indicators.
Best,
Xin