Not out of the box, no. For now, you'd have to write a quick function to handle this.
Here's a rough idea of how I'd approach it.
double highestValue = 0.0;
int since = 0;
List<BarData> bars = BarCollections[symbol];
for (int index = bars.Count - 20; index < bars.Count; index++)
if (bar.Close > highestValue)
highestValue = bar.Close;
int since = index;
since = bars.Count - since;
This may be a good utility class for us to implement though.
It depends on the event. Much of our bar analysis functions are in the BarUtils class
. You can get things like HighestHigh, LowestLow, Lookback, etc.
How do I determine how many bars ago a particular event occurred?
For instance, Bars Since ( close == highestvalue(close,last 20 bars) );