Hello Peter,
This is a can from TOS price performance => Near_High_Lows when current price is within 3% of the 252 period low.
#Wizard text: The current price
##Wizard input: price
#Wizard text: is within
#Wizard input: choice1
#Wizard text: % of the
#Wizard input: period
#Wizard text: period
#Wizard input: choice
def price = close;
input period = 252;
input choice = {default High, Low, “High or Low”};
input choice1 = 3.0;
def hi = high;
def lo = low;
plot scan;
switch (choice) {
case High:
scan = price >= highest(hi,period)* ((100 – choice1) /100);
case Low:
scan = price <= lowest(lo,period)* ((100 + choice1) /100);
case “High or Low”:
scan = price >= highest(hi,period)* ((100 – choice1) /100) or price <= lowest(lo,period)* ((100 + choice1) /100)
;
}
Can you help me so it can scan when current price is between 3% and 30% ?
Like this:
Like Loading...