PureBytes Links
Trading Reference Links
|
These formulas are not equivelant at all. Statment A: asks if C is greater
than 1 or 0. And Statement B: asks if C is greater than yesterdays C.
Prev is a recursive statement... For example if I say 1+prev... the result
would grow by one each day... 1 +prev = 1 , 1 + prev = 2, 1 + prev = 3, etc.
The ref function references a data point x days forward or back.
Michael
-----Original Message-----
From: owner-metastock@xxxxxxxxxxxxx
[mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of jhmtn
Sent: Wednesday, March 14, 2001 10:48 AM
To: metastock@xxxxxxxxxxxxx
Subject: Question
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
|