Hello all -
I've lately been interested in range and when to take profit and when to accept a loss. I found someone else's indicator that compares Day Range to ATR in a label format that I would like to use. But, it only plots two decimals. Not effective for FX trading. I'll post the code below. Would appreciate a tip. Thanks.
I've lately been interested in range and when to take profit and when to accept a loss. I found someone else's indicator that compares Day Range to ATR in a label format that I would like to use. But, it only plots two decimals. Not effective for FX trading. I'll post the code below. Would appreciate a tip. Thanks.
Code:
##### TS ATR
##### Made By Leonard
##### Version 1
##### 4/23/2015
##### Copyright Leonard Tulko 2014 - 2015 All rights reserved
##### This software is licensed for individual use only.
declare upper;
input ATRLength = 14;
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) + " - ATR:" +round(ATR,2));
Last edited by a moderator: