J
jayabner
Guest
Hey there, so I was wondering if anyone can please help me create a label that displays $PCALL current condition that works across all time frames. If above 1 it can be color green & if below, say, .60 it could be color red else neutral gray. The code below is the one I currently have but every time I switch over to a smaller time frame than the Daily the info on the label disappears and goes blank. Any and all help is much appreciated! Thank you in advance.
def pcClose = close(symbol = "$PCALL");
def pcSMA = Average(pcClose, 10);
def value = pcClose / pcSMA;
AddLabel(yes, Concat(Concat(Concat("P/C: ", Round(pcClose, 2)), " SMA: "), Round(pcSMA, 2)), if value > 1.0 then Color.RED else if value > 0.8 then Color.GRAY else Color.GREEN);
def pcClose = close(symbol = "$PCALL");
def pcSMA = Average(pcClose, 10);
def value = pcClose / pcSMA;
AddLabel(yes, Concat(Concat(Concat("P/C: ", Round(pcClose, 2)), " SMA: "), Round(pcSMA, 2)), if value > 1.0 then Color.RED else if value > 0.8 then Color.GRAY else Color.GREEN);
Last edited by a moderator: