At the start of the indicator H1 = 0 and L1 = 0 Evaluate on each period close; If Current Close > Previous Close AND If Current Close > H1 THEN Current Close = H1 AND the old H1 becomes H2, the old H2 becomes H3, the old H3 becomes H4 If Current Close < Previous Close AND Current Close < H1 THEN Current Close = L1 AND the old L1 becomes L2, the old L2 becomes L3, the old L3 becomes L4