I understand that there are bar types such as Renko bars that use "RemoveLastBar()" and which cannot be used with tick replay. I further understand that I am able to check the current bar type via "BarsArray[0].BarsType.IsRemoveLastBarSupported" for this property.
Following questions:
(1) The description in the help guide is rather meagre. It does not explain what this property is all about.
(2) If I look at a few system indicators, they check for the property IsRemoveLastBarSupported().
I just had a look at the WMA which uses two different algorithms depending on whether the bar type holds that property "IsRemoveLastBarSupported". This is confusing to me.
As far as I can see
- all bar types will work with both algorithms
- the first algorithm is a slow algorithm that loops through the last elements of the Input series for every single tick
- the second algorithm is a recursive algorithm which is faster and does not use any loops
- the second algorithm is also inefficient, because it performs a few unnecessary calculations with every tick which can be done for the first tick only
Why would I use the first algorithm at all? The code does not make any sense to me.
Or is there anything that I did not understand?
Comment