Today's close less than daily close scanner?

V

veerasareddy

New member
Hello,

Could someone helps to compile the scanner for below :

Today Hourly Close is less than Previous day Daily Close.


Thanks..
 
Last edited by a moderator:
V

veerasareddy

New member
Hello @BenTen,

Could you please help to build a scanner for

Today Hourly Close is less than Previous day Daily Close.

Thank you.
 
BenTen

BenTen

Administrative
Staff
VIP
See if this is what you're looking for:

Code:
# Plot Arrow if Today's Close is less than Previous Day Close

input ShowTodayOnly = no;

def Today = if GetDay() == GetLastDay() then 1 else 0;

#Plot yesterday's close
plot prevClose = if ShowTodayOnly and !Today then Double.NaN else close(period = "day")[1];

prevClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
prevClose.SetDefaultColor(Color.UPTICK);
prevClose.SetLineWeight(1);

def rule = close < prevClose;

plot arrow_signal = rule;
arrow_signal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
arrow_signal.SetDefaultColor(Color.CYAN);
arrow_signal.SetLineWeight(1);
Watch this video if you don't know how to use the scanner: https://usethinkscript.com/threads/how-to-use-the-tos-scanner.284/
 
horserider

horserider

Well-known member
VIP
@veerasareddy I do not believe you can scan for a second period. So on hourly scan you cannot scan for daily close. Otherwise you could try this.
close crosses DailySMA("length" = 2) within 3 bars

But if do scan agg of hourly it will throw an error.
 

Similar threads

Top