Scan for Candle which closes at the top 10% of its range

N

Nick

Active member
2019 Donor
VIP
Hello everyone, I am looking for a scanner which can scan out whether the current candle closes top 10% of its range or bottom 10% of its range. Does anyone has the code for it? Thank you
 
M

mashume

Active member
VIP
Could something like this fit what you're looking for:
Code:
def range = high - low;
def top10 = high - (0.1 * range);
def lowest10 = low + (0.1 * range);

plot top = if close >= top10 then 1 else double.nan;
# plot bottom = if close <= lowest10 then 1 else double.nan;
run on a Day aggregation right now, it finds a LOT of things.

-mashume
 
N

Nick

Active member
2019 Donor
VIP
@mashume thank you very much. Will test it out shortly.
 

Similar threads

Top