I'm attempting to have MAX look back within the barsAgo but only when in a position (e.g. long/short). So the relative barsAgo would update so long as the position wasn't flat.
I've written something along these lines but can't seem to get the language to pass when applying myCounter to barsAgo:
private Series<double> myCustomSeries;
private MAX ref_MAX;
private Series<int> myCounter
protected override void OnStateChange()
{
else if (State == State.DataLoaded)
Thanks,
Comment