Modified Heiken Ashi Help

Omar

New member
Hello everyone I am trying to do something like on the picture below.

On the left side is the normal heiken ashi candlestick chart and on the right is also heiken ashi but it has built in trend that depending on the previous close it will be green or red. Can anyone helped me create something like this thanks.

ozA8YCy.png


zHPD6y0.png
 
Last edited by a moderator:

HighBredCloud

Well-known member
VIP
@Omar Try if this is what you are looking for.

Code:
def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, HAopen[1] + HAclose[1], open[1] + close)/2;

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

haclose = (HAopen + HAhigh + HAlow + HAclose[1]) / 4;

AssignPriceColor(if HAclose > HAopen

#                 then color.gray

#                 else color.downtick);

                 then color.GREEN

                 else color.RED);
 

Similar threads

Top