0

My condition is to identify 3 lower lows.

Once this condition is satisfied. I want to plot lines for the next 3 days with the below condition.

Cond1: lower Low -(Lower low * 2%) Cond2: lower Low -(Lower low * 3%)

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189

1 Answers1

0

This should give you whether the last x number of bars are making lower lows.

lowerLowCount = 3;

// Identify if current bar is a lower low.
isLowerLowCurrent = low < Ref(low, -1);

// Use sum to check last x bars are all lower lows.
isLowerLowCount = Sum(isLowerLowCurrent, lowerLowCount) == lowerLowCount;

Boolean True and False values can also be used as 1's and 0's which is why I can use Sum() on the boolean array isLowerLowCurrent.

Ceres
  • 3,524
  • 3
  • 18
  • 25