3Lower lows condition

124 Views Asked by At

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%)

1

There are 1 best solutions below

0
On

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.