Count how many times VIX has been lower than 10

In other words, we need to sum the 1 and 0 of the previous logical expression, over time.

In the formula expression we can do this by using the function AggregateSum. It returns a result where the value at each observation is the sum of the values of all observations preceding it.

AggregateSum(vix<10)


Using the vix<10 as the operator of AggregateSum, we can determine the number of occurrences, when VIX value has been lower than 10.

The blue line in the chart below is the final result.