Unfortunately, I am seeing some issues: values older than 1 year are duplicates of the value in the 'last' year of the plot. Or in other words: the indicator pattern is cyclic with a length of about 1 year.
Looking at the code, this does not seem to be too surprising: The strategy exposes a Series<double> for the plot values and the indicator accesses this asynchronously using GetValueAt(). A series will initialize with a length of MaximumBarsLookBack at the time of instantiation - hence the plots being cyclic.
Without knowing enough about NT right now, I assume that the length of the series is equivalent to MaximumBarsLookBack, which is set to 256 - hence the plots being cyclic with almost exactly one year.
I don't want to set MaximumBarsLookBack to infinite for my whole strategy, so I came up with this:
var tmp = MaximumBarsLookBack;
MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
EquityPercentPlot = new Series<double>(this);
DrawdownPercentPlot = new Series<double>(this);
MaximumBarsLookBack = tmp;
I feel it's a terrible hack and was wondering if there was any better/ recommended solution for this issue?
Thank you,
best regards, Felix
Comment