JL356
New member
Hi everyone this is from a script here. Is there a way to get the candle to show over the TTM trend, its one or the other, thanks in advance.
def HAclose = ohlc4;
rec HAopen = compoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh = Max( high, Max( HAopen, HAclose ) );
def HAlow = Min( low, Min( HAopen, HAclose ) );
def haBuy = HAopen <= HAlow;
def haSell = HAopen >= HAhigh;
rec count=if haBuy==1 and count[1]==0 then 1 else if haSell==0 and count[1]>=1 then count[1]+1 else 0;
rec count1=if haSell==1 and count1[1]==0 then 1 else if haBuy==0 and count1[1]>=1 then count1[1]+1 else 0;
def PrimaryUP = if HAopen <= HAlow and habuy==1 and count[1]==0 then yes else no;
def PrimaryDOWN = if HAopen >= HAhigh and hasell==1 and count1[1]==0 then yes else no;
assignpricecolor (if PrimaryUP then Color.white else color.current) ;
AssignPriceColor (if PrimaryDOWN then Color.white else color.current) ;
def shavenBottom = HAopen <= HAlow;
def shavenTop = HAopen >= HAhigh;
def HAclose = ohlc4;
rec HAopen = compoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh = Max( high, Max( HAopen, HAclose ) );
def HAlow = Min( low, Min( HAopen, HAclose ) );
def haBuy = HAopen <= HAlow;
def haSell = HAopen >= HAhigh;
rec count=if haBuy==1 and count[1]==0 then 1 else if haSell==0 and count[1]>=1 then count[1]+1 else 0;
rec count1=if haSell==1 and count1[1]==0 then 1 else if haBuy==0 and count1[1]>=1 then count1[1]+1 else 0;
def PrimaryUP = if HAopen <= HAlow and habuy==1 and count[1]==0 then yes else no;
def PrimaryDOWN = if HAopen >= HAhigh and hasell==1 and count1[1]==0 then yes else no;
assignpricecolor (if PrimaryUP then Color.white else color.current) ;
AssignPriceColor (if PrimaryDOWN then Color.white else color.current) ;
def shavenBottom = HAopen <= HAlow;
def shavenTop = HAopen >= HAhigh;