I have a couple of labels on my chart. One is the Highest price, the second is the percentage off of the high. The labels work as intended. This is used on a Monthly/Max chart.
Labels:
input price = high;
def H = HighestAll(high);
def Per = ((HighestAll(high)-close)/HighestAll(high))*100;
AddLabel(1, "HighestAll = : + H, Color.CYAN);
AddLabel(1, "% Off High = : + Per, Color.CYAN);
I wanted to add this to a scan, to find names that are within 20% of the high. It's returning names that are well beyond 20... The aggregation in the Scanner Custom Filter is set to Mo.
def Per = ((HighestAll(high)-close)/HighestAll(high))*100;
def Tight = if Per <= 20 then 1 else 0;
plot signal = if Tight then 1 else 0;
What do I have wrong?
Labels:
input price = high;
def H = HighestAll(high);
def Per = ((HighestAll(high)-close)/HighestAll(high))*100;
AddLabel(1, "HighestAll = : + H, Color.CYAN);
AddLabel(1, "% Off High = : + Per, Color.CYAN);
I wanted to add this to a scan, to find names that are within 20% of the high. It's returning names that are well beyond 20... The aggregation in the Scanner Custom Filter is set to Mo.
def Per = ((HighestAll(high)-close)/HighestAll(high))*100;
def Tight = if Per <= 20 then 1 else 0;
plot signal = if Tight then 1 else 0;
What do I have wrong?