I want a label on my chart to tell me the percentage difference in closing price, from the highest close to the lowest close, over the last 3 weeks. Just the closing price, not the highs and the lows. How do I reference the close? I have nearly the same thing, for the percentage change between the highest and lowest price of the past 5 daily bars, and trying to convert it, I'm missing something.
What I have is...
input aggregationPeriod = AggregationPeriod.WEEK;
input price_type = close;
input count = 3;
def l = low(period = aggregationperiod.week);
def h = high(period = aggregationperiod.week);
def ThreeWeekHigh = highest(h,count);
def ThreeWeekLow = lowest(l,count);
def ThreeWeekVol = (ThreeWeekHigh-ThreeWeekLow)/ThreeWeekLow*100;
AddLabel(1,"3 Week Vol: " + Round(ThreeWeekVol,2), Color.ORANGE);
I'm getting the High and Low of the last 3 weeks... Not the highest and lowest close. What am I doing wrong? Or... How much of this is just plain wrong!?
Thanks,
Charlie
Thought maybe... But no!
input aggregationPeriod = AggregationPeriod.WEEK;
input price_type = close;
input length = 3;
def l = Lowest(close,3);
def h = Highest(close,3);
def ThreeWeekHigh = Highest(h,length);
def ThreeWeekLow = Lowest(l,length);
def ThreeWeekVol = (ThreeWeekHigh-ThreeWeekLow)/ThreeWeekLow*100;
AddLabel(1,"3 Week Vol: " + Round(ThreeWeekVol,2), Color.ORANGE);
What I have is...
input aggregationPeriod = AggregationPeriod.WEEK;
input price_type = close;
input count = 3;
def l = low(period = aggregationperiod.week);
def h = high(period = aggregationperiod.week);
def ThreeWeekHigh = highest(h,count);
def ThreeWeekLow = lowest(l,count);
def ThreeWeekVol = (ThreeWeekHigh-ThreeWeekLow)/ThreeWeekLow*100;
AddLabel(1,"3 Week Vol: " + Round(ThreeWeekVol,2), Color.ORANGE);
I'm getting the High and Low of the last 3 weeks... Not the highest and lowest close. What am I doing wrong? Or... How much of this is just plain wrong!?
Thanks,
Charlie
Thought maybe... But no!
input aggregationPeriod = AggregationPeriod.WEEK;
input price_type = close;
input length = 3;
def l = Lowest(close,3);
def h = Highest(close,3);
def ThreeWeekHigh = Highest(h,length);
def ThreeWeekLow = Lowest(l,length);
def ThreeWeekVol = (ThreeWeekHigh-ThreeWeekLow)/ThreeWeekLow*100;
AddLabel(1,"3 Week Vol: " + Round(ThreeWeekVol,2), Color.ORANGE);