Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 8/23/2012 Posts: 59
|
Hi, need some help to create the following PCFs:
PCF_1:
-Stochastics K line crosses down D line
-Cross happens above SMA21
PCF_2:
-Stochastics K line crosses up D line
-Cross happens above SMA21
Note:
-SMA21 is calculated based on Stochastics K line
-Stochastics settings: 21, 3, 3
-Cross should happen between 1 and 2 bars ago (not current bar).
Thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try the following for PCF_1:
(AVG(STOC21.3.1,21) < STOC21.3.1 AND STOC21.3.1 < AVG(STOC21.3.1,3) AND AVG(STOC21.3.2,3) <= STOC21.3.2) OR (AVG(STOC21.3.2,21) < STOC21.3.2 AND STOC21.3.2 < AVG(STOC21.3.2,3) AND AVG(STOC21.3.3,3) <= STOC21.3.3)
And the following for PCF_2:
(AVG(STOC21.3.1,21) > STOC21.3.1 AND STOC21.3.1 > AVG(STOC21.3.1,3) AND AVG(STOC21.3.2,3) >= STOC21.3.2) OR (AVG(STOC21.3.2,21) > STOC21.3.2 AND STOC21.3.2 > AVG(STOC21.3.2,3) AND AVG(STOC21.3.3,3) >= STOC21.3.3)
Understanding Stochastics
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 8/23/2012 Posts: 59
|
Hi Bruce, I tried the PCFs but are giving strange results.
I've changed to the following,
PCF_1:
STOC21.3.2 > AVG(STOC21.3.2,3) AND STOC21.3.1 < AVG(STOC21.3.1,3) AND STOC21.3.2 > AVG(STOC21.3.2,21)
PCF_2:
STOC21.3.2 < AVG(STOC21.3.2,3) AND STOC21.3.1 > AVG(STOC21.3.1,3) AND STOC21.3.2 > AVG(STOC21.3.2,21)
Is this correct ? You were also using Bar 3 why ?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I was checking for the cross happening either 1 or 2 bars ago (with the 2 bars ago version needing data from 3 bars ago) because of your statement that "Cross should happen between 1 and 2 bars ago (not current bar)."
I thought about the interepretation that "between 1 and 2 bars ago" meant the cross was just a 1 bar ago version but discarded this (apparently correct) interpretation because of the "(not current bar)" section which would have needed to be more like "(not between current bar and 1 bar ago)" to have a parallel construction consistent with this interpretation.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 8/23/2012 Posts: 59
|
Ok Bruce, got your point. I will test the PCFs and let you know the results.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I don't see any problems with your formulas, but I have noticed a slight difference though. My formulas checked for %K to be above or below the SMA21 on the second of the two bars involved in the cross while your formulas appear to check for this to be true on the first of the two bars involved in the cross.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |