Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 3/17/2005 Posts: 187
|
Hi guys,I would like write a pcf for stock crossing prior week low and another one for prior week high.C > MAXH5.5 will only give me close above the high for the past 5 days..Prior week, I mean last week high and lowthanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (malick) Prior week, I mean last week high and low
If you mean a calendar week, it is not happening in TeleChart (although you could do so in StockFinder). The weeks in TeleChart are based on rolling 5-Trading Day Bars.
QUOTE (malick) I would like write a pcf for stock crossing prior week low and another one for prior week high.C > MAXH5.5 will only give me close above the high for the past 5 days.
C > MAXH5.5 looks for the current Price being above the High of the previous Weekly Bar (not "close above the high for the past 5 days", which would be C > MAXH5.1).
If you are looking for the current Close to be above the High of the previous Weekly Bar and the Close of yesterday to be at or below the High of the previous Weekly Bar (as of today), you could use:
C > MAXH5.5 AND C1 <= MAXH5.5
If you are looking for the current Close to be below the High of the previous Weekly Bar and the Close of yesterday to be at or above the High of the previous Weekly Bar (as of today), you could use:
C < MAXH5.5 AND C1 >= MAXH5.5
If you are looking for the Close to be passing through the High of the previous Weekly Bar (as of today) between yesterday and today (in either direction), you could use:
SGN(C - MAXH5.5) <> SGN(C1 - MAXH5.5)
If you are looking for the current Close to be above the Low of the previous Weekly Bar and the Close of yesterday to be at or below the Low of the previous Weekly Bar (as of today), you could use:
C > MINL5.5 AND C1 <= MINL5.5
If you are looking for the current Close to be below the Low of the previous Weekly Bar and the Close of yesterday to be at or above the Low of the previous Weekly Bar (as of today), you could use:
C < MINL5.5 AND C1 >= MINL5.5
If you are looking for the Close to be passing through the Low of the previous Weekly Bar (as of today) between yesterday and today (in either direction), you could use:
SGN(C - MINL5.5) <> SGN(C1 - MINL5.5)
There are lots of other possible interpretations of "crossing prior week low or high" (both "crossing" and "prior week" can be interpreted a variety of ways when comparing Daily and Weekly Bars), so the above list is far from exhaustive. You may wish to review the following:
PCF Formula Descriptions
How to create a Personal Criteria Forumula (PCF)
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/17/2005 Posts: 187
|
Thanks..I was looking for calendar week
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |