Hi all,

I am trying to get Daily ATR value using Resolution Daily but failed when I subscribed Min Data. Code is as followed. I found that the only way for me to get the correct ans is to change the AddCrypto back to Resolution Daily but then I will not get the minute data for other indicator. Did I do something wrong?

  1. # region imports
  2. from AlgorithmImports import *
  3. # endregion
  4. class DancingBrownShark(QCAlgorithm):
  5. def Initialize(self):
  6. self.SetStartDate(2021, 3, 1) # Set Start Date
  7. self.SetCash(100000) # Set Strategy Cash
  8. self.AddCrypto("ETHUSDT", Resolution.Minute)
  9. self.atr = self.ATR("ETHUSDT", 14, Resolution.Daily)
  10. def OnData(self, data: Slice):
  11. if self.atr.IsReady:
  12. self.Log(f"{self.Time} {self.atr.Current.Value}")

Author

Napoleon

August 2022