When using :
if (nState == BARSTATE_NEWBAR)
xStochK = stochK(27,13,13,inv(myFp[x]));
where myFp[x] = 30, and I am running on a 2 minute chart, returns the 30 minute stochastic calculated at the 2 minute interval - that is, I will get 15 different fluctuating values during the 30 minute period, rather than the value at the close of the last 30 minute bar.
How can I return the value at the close of the last 30 minute bar, at the close of each 2 minute bar, and only return a new value every 15 X 2 min bars? I suspect I will need to keep track of time and calculate my own 30 minute open/close times, however am not sure how to do this.
Hope I explained that ok, and appreciate any help.
Cheers
if (nState == BARSTATE_NEWBAR)
xStochK = stochK(27,13,13,inv(myFp[x]));
where myFp[x] = 30, and I am running on a 2 minute chart, returns the 30 minute stochastic calculated at the 2 minute interval - that is, I will get 15 different fluctuating values during the 30 minute period, rather than the value at the close of the last 30 minute bar.
How can I return the value at the close of the last 30 minute bar, at the close of each 2 minute bar, and only return a new value every 15 X 2 min bars? I suspect I will need to keep track of time and calculate my own 30 minute open/close times, however am not sure how to do this.
Hope I explained that ok, and appreciate any help.
Cheers
Comment