ROC vs Close/close(-1)
Author: sourkraut
Creation Date: 4/28/2011 3:45 PM
profile picture

sourkraut

#1
Using the definition of ROC in the Wiki,
"ROC(bar) = 100 * ( ( Pricebar / Pricebar - period ) - 1 )"

Is there a difference between

"ROC(Close,5)" and "100 * Close / (Cose >> 5) - 1" ?

If not, is there a strong reason to prefer one over the other? Which one?

Finally, is there a way to access a single bar value of ROC without creating a new data series?


TIA
profile picture

Eugene

#2
QUOTE:
Finally, is there a way to access a single bar value of ROC without creating a new data series?

Yes, the ROC.Value method.
CODE:
Please log in to see this code.

There should be no difference and you can use any version but the correct version of your code would be:
QUOTE:
"100 * (Close / (Close >> 5) - 1)"
profile picture

sourkraut

#3
Thanks

This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).