Registered User Joined: 3/25/2012 Posts: 28
|
Hi, how can I formulate if yesterday's high or the day before yesterday's high was the highest in last 30 days?
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It depends on what you actually mean.
The highest high in the 30 bars ending with the current bar is:
MAXH30
And the highest high in the 30 bars ending with the previous bar is:
MAXH30.1
The high of 1 bar ago is:
H1
The high of 2 bars ago is:
H2
And the higher of 1 and 2 bars ago is:
MAXH2.1
So it ends up being a matter of combining these terms in the way that actually matches the intent of your question. If either yesterday's high or the day before yesterday's high needs to be at the highest point in the 30 days ending today:
MAXH2.1 = MAXH30
If the 30 days end yesterday:
MAXH2.1 = MAXH30.1
If one or both of those bars needs to be higher than all of the other bars:
MAXH2.1 > MAXH28.3
If each of those bars is being compared to its own set of 30-bars ending on that particular bar:
H1 > MAXH29.2 OR H2 > MAXH29.3
There are a lot of other possible interepretations as well.
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|