[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question



PureBytes Links

Trading Reference Links

There have been some posts lately using either the 'ref' or the 'PREV'
functions.  My question is: are the 2 functions mathematically equivalent?
And, would there ever be a reason that you would be forced to use 'PREV'
over 'ref '?  The following is an example I created (not very sophisticated)
that created a binary output based upon whether today's close was greater
than yesterdays close which seems to show that the two are equivalent.

Statement A:   x:= If(C > PREV, 1, 0);
Statement B:   x:= If(C > ref(C,-1), 1, 0);

Thoughts? ........ John