Hi all,

I was debugging a problem with Heikin Ashi and Rolling Windows and it took me a while to realized that the “CurrentBar” examples mentioned here by Derek Melchin isn't available any more.

I solved my problem converting the IndicatorDataPoint from the HeikinAshi into a TradeBar using the code below:

  1. def OnFiveMinuteHeikinAshiUpdated(self, sender, updated):
  2. if self.fiveMinuteHeikinAshi.IsReady:
  3. tradeBar = TradeBar(updated.EndTime, self.symbol, sender.Open.Current.Value, sender.High.Current.Value, sender.Low.Current.Value, sender.Close.Current.Value, sender.Volume.Current.Value)
  4. self.fiveMinuteHeikinAshiWindow.Add(tradeBar)

It's working, but I was wondering is this is the best recommendation for these cases.

Author

Rafael Trevisan

June 2022