ATR Scanner Setup

J

JMath3

New member
VIP
Hey Guys,

I want to use this ATR script for scanning, but I'm having trouble with it. Would appreciate the help.

I want to find stocks within my watchlist, for example a 5% or greater move.

Code:
input length = 14;
input averageType = AverageType.WILDERS;
input day_period = AggregationPeriod.DAY;

def ATR_day = if day_period >= AggregationPeriod.MIN then MovingAverage(averageType, TrueRange(high(period = day_period), close(period = day_period), low(period = day_period)), length) else Double.NaN;

def ATR_day_percent = ATR_day/close * 100 ;

plot labelColor = 0; # only to pull in color select widget
labelColor.SetHiding(1) ; #never want to show this
labelColor.HideBubble();
labelColor.HideTitle();
labelColor.SetDefaultColor(Color.PLUM);

AddLabel(day_period >= AggregationPeriod.MIN,Concat(Concat(Concat( Concat(if day_period == AggregationPeriod.DAY then "Daily ATR: " else if day_period == AggregationPeriod.WEEK then "Weekly ATR: " else if day_period == AggregationPeriod.MONTH then "Monthly ATR: " else "", ATR_day)," => "), ATR_day_percent),"%" ), labelColor.TakeValueColor() );
 

Similar threads

Top