I am trying to create a simple lower study that will show a graph of the average daily range of the SPX over the last 14 days.
Here is what I have so far:
declare lower;
input length = 14;
input BasePeriod = AggregationPeriod.DAY;
def Today_High = Highest(high(period = baseperiod)[0], 1);
def Today_Low = Lowest(low(period =baseperiod)[0], 1);
def DR = Today_High - Today_Low;
DR should be the daily range of the SPX. How do I get it to graph the 14 day average?
Thanks!
Here is what I have so far:
declare lower;
input length = 14;
input BasePeriod = AggregationPeriod.DAY;
def Today_High = Highest(high(period = baseperiod)[0], 1);
def Today_Low = Lowest(low(period =baseperiod)[0], 1);
def DR = Today_High - Today_Low;
DR should be the daily range of the SPX. How do I get it to graph the 14 day average?
Thanks!