Modify Consecutive Heikin Ashi candles

9

9ramone7

New member
Can anyone help me? To modify this code to switch between the amount of Consecutive Green Heikin Ashi candles after a Red Heikin Ashi candle.

This code finds the last two Consecutive Green Heikin Ashi candles after a Red Heikin Ashi candle but i wanted to lets say add three or even four candles.
Code:
def haClose = ohlc4;
def haOpen = if haOpen[1] == 0 then haClose[1] else (haOpen[1] + haClose[1]) / 2;
def haHigh = Max(high, Max(haClose, haOpen));
def haLow = Min(low, Min(haClose, haOpen));
def haColor = haClose > haOpen;
def trendUp = haColor and haColor[1] and !haColor[2];



maybe even change the blue arrows to arrows thats underneath the bars instead
 
Last edited by a moderator:
9

9ramone7

New member
Modified a little bit but now a scan is needed. The red arrows are underneath the fourth consecutive Heikin Ashi candle

 
Last edited by a moderator:

Similar threads

Top