Is it correct to use 'getValue(5)' to plot the value for the current bar 5 bars in the past?
Definition from efs Library Help:
getValue = "Returns the value of the specified type at the specified bar index relative to the bar currently being processed."
Attached is a simple code sample displaying 3 moving averages all the same...all are simple moving averages of 10 bars based on the close.
What I am displaying are different index values (from each study...moving average) using 'getValue'.
xStudy1.getValue(5) = green
xStudy2.getValue(-5) = red
xStudy1.getValue(0) = black
While getValue(0) is returning the value of (the simple 10 bar moving average based on the close) for the current bar am I right in presuming that getValue(-5) gives the same value offset 5 bars into the future? I guess I find the -5 (as opposed to +5) to be confusing to indicate movement 'forward' in time.
What I want to confirm is that - it's correct to use 'getValue(5)' to plot the value for the current bar 5 bars in the past?
Thanks,
g
Definition from efs Library Help:
getValue = "Returns the value of the specified type at the specified bar index relative to the bar currently being processed."
Attached is a simple code sample displaying 3 moving averages all the same...all are simple moving averages of 10 bars based on the close.
What I am displaying are different index values (from each study...moving average) using 'getValue'.
xStudy1.getValue(5) = green
xStudy2.getValue(-5) = red
xStudy1.getValue(0) = black
While getValue(0) is returning the value of (the simple 10 bar moving average based on the close) for the current bar am I right in presuming that getValue(-5) gives the same value offset 5 bars into the future? I guess I find the -5 (as opposed to +5) to be confusing to indicate movement 'forward' in time.
What I want to confirm is that - it's correct to use 'getValue(5)' to plot the value for the current bar 5 bars in the past?
Thanks,
g
Comment