Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 5/27/2005 Posts: 35
|
Hi Support , My name is Ron and i want you to help me to do the following :
I Have "Custom Cumulative Indicator" that plot a line on the middle window . ( Blue line )
I have also another line on the middle window that plot the "Mov Avg 10" ( yellow line )
I want to write PCF to detect when Crossover occured between My "Custom Cumulative Indicator" line and the "Mov Avg 10" line , when Crossing of the "Custom Cumulative Indicator" ( Blue line) cross to the upside the "Mov Avg 10" ( yellow line )
Here is How i build the "Custom Cumulative Indicator"
Up Condition: c-avgc10>0 and avgc20>(avgc20+avgc20.1+avgc20.2)/3
Down Condition: c-avgc10<0 and avgc20<(avgc20+avgc20.1+avgc20.2)/3
Value to Add/Substruct : 1+1
So What i want is to detect when my "Custom Cumulative Indicator" crossing to the upside the Moving Average 10 . and put this in PCF .
thanks
Ron
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Is it a simple or exponential moving average?
- Craig Here to Help!
|
|
Registered User Joined: 5/27/2005 Posts: 35
|
Hi Craig ,
It is a Simple moving average ,
i just want to detect when my indicator crossing up the 10 Simple Moving average .
thanks
Ron
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
ronbary, Please try the following:
0 > 9 * ((C > AVGC10 AND AVGC20 > AVG(AVGC20,3)) - (C < AVGC10 AND AVGC20 < AVG(AVGC20,3))) + 8 * ((C1 > AVGC10.1 AND AVGC20.1 > AVG(AVGC20.1,3)) - (C1 < AVGC10.1 AND AVGC20.1 < AVG(AVGC20.1,3))) + 7 * ((C2 > AVGC10.2 AND AVGC20.2 > AVG(AVGC20.2,3)) - (C2 < AVGC10.2 AND AVGC20.2 < AVG(AVGC20.2,3))) + 6 * ((C3 > AVGC10.3 AND AVGC20.3 > AVG(AVGC20.3,3)) - (C3 < AVGC10.3 AND AVGC20.3 < AVG(AVGC20.3,3))) + 5 * ((C4 > AVGC10.4 AND AVGC20.4 > AVG(AVGC20.4,3)) - (C4 < AVGC10.4 AND AVGC20.4 < AVG(AVGC20.4,3))) + 4 * ((C5 > AVGC10.5 AND AVGC20.5 > AVG(AVGC20.5,3)) - (C5 < AVGC10.5 AND AVGC20.5 < AVG(AVGC20.5,3))) + 3 * ((C6 > AVGC10.6 AND AVGC20.6 > AVG(AVGC20.6,3)) - (C6 < AVGC10.6 AND AVGC20.6 < AVG(AVGC20.6,3))) + 2 * ((C7 > AVGC10.7 AND AVGC20.7 > AVG(AVGC20.7,3)) - (C7 < AVGC10.7 AND AVGC20.7 < AVG(AVGC20.7,3))) + (C8 > AVGC10.8 AND AVGC20.8 > AVG(AVGC20.8,3)) - (C8 < AVGC10.8 AND AVGC20.8 < AVG(AVGC20.8,3)) AND 0 <= 9 * ((C1 > AVGC10.1 AND AVGC20.1 > AVG(AVGC20.1,3)) - (C1 < AVGC10.1 AND AVGC20.1 < AVG(AVGC20.1,3))) + 8 * ((C2 > AVGC10.2 AND AVGC20.2 > AVG(AVGC20.2,3)) - (C2 < AVGC10.2 AND AVGC20.2 < AVG(AVGC20.2,3))) + 7 * ((C3 > AVGC10.3 AND AVGC20.3 > AVG(AVGC20.3,3)) - (C3 < AVGC10.3 AND AVGC20.3 < AVG(AVGC20.3,3))) + 6 * ((C4 > AVGC10.4 AND AVGC20.4 > AVG(AVGC20.4,3)) - (C4 < AVGC10.4 AND AVGC20.4 < AVG(AVGC20.4,3))) + 5 * ((C5 > AVGC10.5 AND AVGC20.5 > AVG(AVGC20.5,3)) - (C5 < AVGC10.5 AND AVGC20.5 < AVG(AVGC20.5,3))) + 4 * ((C6 > AVGC10.6 AND AVGC20.6 > AVG(AVGC20.6,3)) - (C6 < AVGC10.6 AND AVGC20.6 < AVG(AVGC20.6,3))) + 3 * ((C7 > AVGC10.7 AND AVGC20.7 > AVG(AVGC20.7,3)) - (C7 < AVGC10.7 AND AVGC20.7 < AVG(AVGC20.7,3))) + 2 * ((C8 > AVGC10.8 AND AVGC20.8 > AVG(AVGC20.8,3)) - (C8 < AVGC10.8 AND AVGC20.8 < AVG(AVGC20.8,3))) + (C9 > AVGC10.9 AND AVGC20.9 > AVG(AVGC20.9,3)) - (C9 < AVGC10.9 AND AVGC20.9 < AVG(AVGC20.9,3))
You may wish to review the following:
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: 5/27/2005 Posts: 35
|
Bruce
Thanks , It works fine.
Now how can i do just the opposite , detect when the Indicator Crossing down the 10 SMA .
thanks
Ron
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try the following:
0 < 9 * ((C > AVGC10 AND AVGC20 > AVG(AVGC20,3)) - (C < AVGC10 AND AVGC20 < AVG(AVGC20,3))) + 8 * ((C1 > AVGC10.1 AND AVGC20.1 > AVG(AVGC20.1,3)) - (C1 < AVGC10.1 AND AVGC20.1 < AVG(AVGC20.1,3))) + 7 * ((C2 > AVGC10.2 AND AVGC20.2 > AVG(AVGC20.2,3)) - (C2 < AVGC10.2 AND AVGC20.2 < AVG(AVGC20.2,3))) + 6 * ((C3 > AVGC10.3 AND AVGC20.3 > AVG(AVGC20.3,3)) - (C3 < AVGC10.3 AND AVGC20.3 < AVG(AVGC20.3,3))) + 5 * ((C4 > AVGC10.4 AND AVGC20.4 > AVG(AVGC20.4,3)) - (C4 < AVGC10.4 AND AVGC20.4 < AVG(AVGC20.4,3))) + 4 * ((C5 > AVGC10.5 AND AVGC20.5 > AVG(AVGC20.5,3)) - (C5 < AVGC10.5 AND AVGC20.5 < AVG(AVGC20.5,3))) + 3 * ((C6 > AVGC10.6 AND AVGC20.6 > AVG(AVGC20.6,3)) - (C6 < AVGC10.6 AND AVGC20.6 < AVG(AVGC20.6,3))) + 2 * ((C7 > AVGC10.7 AND AVGC20.7 > AVG(AVGC20.7,3)) - (C7 < AVGC10.7 AND AVGC20.7 < AVG(AVGC20.7,3))) + (C8 > AVGC10.8 AND AVGC20.8 > AVG(AVGC20.8,3)) - (C8 < AVGC10.8 AND AVGC20.8 < AVG(AVGC20.8,3)) AND 0 >= 9 * ((C1 > AVGC10.1 AND AVGC20.1 > AVG(AVGC20.1,3)) - (C1 < AVGC10.1 AND AVGC20.1 < AVG(AVGC20.1,3))) + 8 * ((C2 > AVGC10.2 AND AVGC20.2 > AVG(AVGC20.2,3)) - (C2 < AVGC10.2 AND AVGC20.2 < AVG(AVGC20.2,3))) + 7 * ((C3 > AVGC10.3 AND AVGC20.3 > AVG(AVGC20.3,3)) - (C3 < AVGC10.3 AND AVGC20.3 < AVG(AVGC20.3,3))) + 6 * ((C4 > AVGC10.4 AND AVGC20.4 > AVG(AVGC20.4,3)) - (C4 < AVGC10.4 AND AVGC20.4 < AVG(AVGC20.4,3))) + 5 * ((C5 > AVGC10.5 AND AVGC20.5 > AVG(AVGC20.5,3)) - (C5 < AVGC10.5 AND AVGC20.5 < AVG(AVGC20.5,3))) + 4 * ((C6 > AVGC10.6 AND AVGC20.6 > AVG(AVGC20.6,3)) - (C6 < AVGC10.6 AND AVGC20.6 < AVG(AVGC20.6,3))) + 3 * ((C7 > AVGC10.7 AND AVGC20.7 > AVG(AVGC20.7,3)) - (C7 < AVGC10.7 AND AVGC20.7 < AVG(AVGC20.7,3))) + 2 * ((C8 > AVGC10.8 AND AVGC20.8 > AVG(AVGC20.8,3)) - (C8 < AVGC10.8 AND AVGC20.8 < AVG(AVGC20.8,3))) + (C9 > AVGC10.9 AND AVGC20.9 > AVG(AVGC20.9,3)) - (C9 < AVGC10.9 AND AVGC20.9 < AVG(AVGC20.9,3))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |