Registered User Joined: 10/16/2005 Posts: 27
|
Hi Worden,
I would like to create a PCF to ID those stocks opening (+) or (-) of their 1 hour 20 Simple moving average and another for the exponential MA. As always, I really appreciate your help.
|
Registered User Joined: 10/16/2005 Posts: 27
|
Whoops, I forgot to mention that I was wanting a (+) or (-) of 1/2of 1% from the moving average.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You would need to set the Time Frame of the following formulas to 1-Hour. Note that none of the formulas use the open of the day. There is no way to automatically reference the open of the day within an intraday Time Frame. So if you are interested in the open of the day, they would only work during the first bar of the day. You would need to adjust the bars ago parameters in the formulas as the day went on if you were still interested in the results based on the first bar of the trading day.
You can create a Condition Formula for the open of the bar to be within 0.5% of the simple moving average of the close as:
ABS(O / AVGC20 - 1) <= .05
A similar Condition Formula can be create using an exponential moving average by just adding an X to the formula:
ABS(O / XAVGC20 - 1) <= .05
Note that these formula are based on the the value of the moving average of the close at the time of the close of the bar, not at the time of the open of the bar. We would need to calculate the value of the moving average at the time of the open of the bar if that is what of interest.
For the simple moving average, this would be:
ABS(O / ((O + 19 * AVGC19.1) / 20) - 1) <= .05
While we would get the following for an exponential moving average:
ABS(O / (.9 * XAVGC20.1 + 2 * O / 21) - 1) <= .05
-Bruce Personal Criteria Formulas TC2000 Support Articles
|