I am trying to get the average daily range of an instrument and use the number in a calculation on an intraday time frame of the same instrument to then plot a line.
I have:
in variables - private DataSeries drange;
in initialize - Add(PeriodType.Day, 1); but I don't know how to reference this to calculate the daily range then store it as a series.
drange = new DataSeries(this);
What do I do in OnBarUpdate to get the 20 day average range? - It only needs to be calculated at the start of the session and then remain constant till the next session but the rest of my indicator updates on each tick.
I have tried something like
double range = SMA(Drange, Rangeperiod);
with various calculations before hand but nothing seems to give me my value - I then plan to use it for something like
targetup = SessionOpen + range
I obviously cant get it to plot - can anybody point me in the right direction please Kooganam/Sledge et al !!
Thanks in advance.
Comment