Registered User Joined: 10/4/2010 Posts: 11
|
Is there a formula that I can create that will find a SMA cross and alert me to a price retest of the SMA. e.g 10SMA crossing up through the 20SMA and alerting me to a retest of the 10SMA running off of daily data.
Thanks,
Zach
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You might subjectively know it when you see it, but I'm really not sure what you mean in an unambiguous objective sense. I'll make some guesses however.
It is theoretically possible for the 10-Period Simple Moving Average to have always been above the 20-Period Simple Moving Average, but it is incredibly unlikely. This means we should have to test for the crossup, but only need to check for the 10-Period Simple Moving Average being above the 20-Period Simple Moving Average on the prior bar:
AVGC10.1 > AVGC20.1
Now if we are checking for a price retest of of the 10-Period Simple Moving Average, we probably want to test for price being above the 10-Period Simple Moving Average during this bar as well:
C1 > AVGC10.1 AND AVGC10.1 > AVGC20.1
A retest would seem to involve price being at or below the 10-Period Simple Moving Average during the current bar:
C <= AVGC10 AND C1 > AVGC10.1 AND AVGC10.1 > AVGC20.1
Or possible slightly above it while being further above it during the prior bar (the following sets that threshold at 0.5%:
C <= 1.005 * AVGC10 AND C1 > 1.005 * AVGC10.1 AND AVGC10.1 > AVGC20.1
If you want something else, we would need further clarification from you as to your intent.
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 10/4/2010 Posts: 11
|
Thanks Bruce I will play around with these to see if that is what I am looking for. I guess I was a little vague on what I was looking to do, the goal of the alert I am looking for is detecting an area in say a watch list where the 10 period Simple Moving Average crosses up through the 20-Period Simple Moving Average (So that would be "TRUE") but not alerting me until price comes down to test the 10-Period Moving Average or slightly above. Don't know if this explanation is any better, if not I will work with what you gave me and go from there..
Thanks again,
Zach
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|