Adding ATR (Average True Range) in the Chart for Think or Swim (TOS)

Trade Planners
Trade Planners
2.1 هزار بار بازدید - 5 سال پیش - Here is the thinkscript to
Here is the thinkscript to add the ATR
****Copy from next line to the end*******
declare upper;

input ATRLength = 15;
input averagetype = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.DAY;
input showlabel = yes;

def ATR = MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength);

def Today_High = Highest(high(period = baseperiod)[0], 1);
def Today_Low = Lowest(low(period =baseperiod)[0], 1);

def DR = Today_High - Today_Low;

AddLabel(showlabel, "DayRange: " + Round(DR , 2) + " vs. ATR:" +round(ATR,2));
***COPY to Above Line****

Disclaimer
This is not intended to advise anyone to buy or sell a security product. It  is only intended for Education purposes.
5 سال پیش در تاریخ 1398/03/12 منتشر شده است.
2,183 بـار بازدید شده
... بیشتر