Hey,
I'm trying to create a custom watchlist column to indicate if the price cross Prev Day Close. Find below my code for review. Somehow it is not working. Any help is appreciated!!!
Code:
def PrevDayClose=close(period = AggregationPeriod.DAY)[-1];
plot signal = if PrevDayClose>close(period =AggregationPeriod.MIN) then 2 else if PrevDayClose<close(period =AggregationPeriod.MIN) then 1 else 0;
signal.AssignValueColor(if signal == 2 then Color.White else if signal == 1 then Color.White else Color.White);
AssignBackgroundCOlor(if signal == 2 then Color.Dark_Green else if signal == 1 then Color.Dark_Red else Color.Dark_Orange);
Thanks,
AJ
I'm trying to create a custom watchlist column to indicate if the price cross Prev Day Close. Find below my code for review. Somehow it is not working. Any help is appreciated!!!
Code:
def PrevDayClose=close(period = AggregationPeriod.DAY)[-1];
plot signal = if PrevDayClose>close(period =AggregationPeriod.MIN) then 2 else if PrevDayClose<close(period =AggregationPeriod.MIN) then 1 else 0;
signal.AssignValueColor(if signal == 2 then Color.White else if signal == 1 then Color.White else Color.White);
AssignBackgroundCOlor(if signal == 2 then Color.Dark_Green else if signal == 1 then Color.Dark_Red else Color.Dark_Orange);
Thanks,
AJ