Heiken-Ashi watchlist for inside candles


Category:
0
0

Hello Pete. I was able to create a watchlist column which shows whenever an inside bar occurs using the condition wizard. However, I am having trouble creating a watchlist column that simply shows the color of the current Heiken-Ashi and if the bar is trading inside of the previous bar it states “Inside”. Can you please help me create the column. Thank you!

Marked as spam
Posted by (Questions: 19, Answers: 18)
Asked on August 20, 2024 6:39 pm
17 views
0
Private answer

Here you go...

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 haGreen = haClose > haOpen;
def haRed = haClose < haOpen;
def haInside = haHigh < haHigh[1] and haLow > haLow[1];
AddLabel(yes, if haInside then "HA Inside" else " ", Color.BLACK);
AssignBackgroundColor(if haGreen then Color.GREEN else if haRed then Color.RED else Color.CURRENT);

Marked as spam
Posted by (Questions: 37, Answers: 4116)
Answered on August 20, 2024 6:40 pm