It is common to keep track of historical values for various things. Sometimes we need to keep track of the last n bars of data, or sometimes we want to keep track of the last n values for an indicator. This is typically accomplished using a RollingWindow<T> and manually adding the values to the rolling window. In this algorithm, I've defined a HistoryTracker helper class which can make tracking the history of consolidators and indicators a one liner in Initialize!

This works by binding to the event handler on the indicator or consolidator and updating the rolling window from that!

Have a peek and let me know what you guys think!

Author