# ATR Values Regular Method
# tomsk
# 11.21.2019
input length = 14;
input averageType = AverageType.WILDERS;
input agg = AggregationPeriod.DAY;
def HDay = High(period = AggregationPeriod.DAY);
def LDay = Low(period = AggregationPeriod.DAY);
def CDay = Close(period = AggregationPeriod.DAY);
def ATRDay = MovingAverage(averageType, TrueRange(HDay, CDay, LDay), length);
def HWeek = High(period = AggregationPeriod.WEEK);
def LWeek = Low(period = AggregationPeriod.WEEK);
def CWeek = Close(period = AggregationPeriod.WEEK);
def ATRWeek = MovingAverage(averageType, TrueRange(HWeek, CWeek, LWeek), length);
def HMonth = High(period = AggregationPeriod.MONTH);
def LMonth = Low(period = AggregationPeriod.MONTH);
def CMonth = Close(period = AggregationPeriod.MONTH);
def ATRMonth = MovingAverage(averageType, TrueRange(HMonth, CMonth, LMonth), length);
AddLabel(1, " ATR("+ length + ") DAY: " + Round(ATRDay,2) + " WEEK: " + Round(ATRWeek,2) + " MONTH: " + Round(ATRMonth,2), Color.White);
# End ATR Values Regular Method