Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 3/20/2005 Posts: 46
|
i'm trying to create a custom %true indicator of the crossover of "(h+l+c)/3" over its 3 period moving average. i don't imagine it's as hard as i made it but i just can't get it to plot.
thanks.
jl
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try one or more of the following formulas:
(H + L + C) / 3 xUp its own SMA3:
H + L + C > AVGH3 + AVGL3 + AVGC3 AND H1 + L1 + C1 <= AVGH3.1 + AVGL3.1 + AVGC3.1
(H + L + C) / 3 xDn its own SMA3:
H + L + C < AVGH3 + AVGL3 + AVGC3 AND H1 + L1 + C1 >= AVGH3.1 + AVGL3.1 + AVGC3.1
(H + L + C) / 3 crossing its own SMA3 (either direction):
SGN(H + L + C - AVGH3 - AVGL3 - AVGC3) <> SGN(H1 + L1 + C1 - AVGH3.1 - AVGL3.1 - AVGC3.1)
(H + L + C) / 3 xUp its own EMA3:
H + L + C > XAVGH3 + XAVGL3 + XAVGC3 AND H1 + L1 + C1 <= XAVGH3.1 + XAVGL3.1 + XAVGC3.1
(H + L + C) / 3 xDn its own EMA3:
H + L + C < XAVGH3 + XAVGL3 + XAVGC3 AND H1 + L1 + C1 >= XAVGH3.1 + XAVGL3.1 + XAVGC3.1
(H + L + C) / 3 crossing its own EMA3 (either direction):
SGN(H + L + C - XAVGH3 - XAVGL3 - XAVGC3) <> SGN(H1 + L1 + C1 - XAVGH3.1 - XAVGL3.1 - XAVGC3.1)
You may wish to review the following:
Visually Backtesting Specific Symbols
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: 3/3/2013 Posts: 57
|
Morning Bruce,
Two separate questions: How to write PCF Typical Price Xing XAvg2+1 in either direction?
(H + L + C) / 3 xing XMA2+1:
2nd Question:
After reading thru your previous posts, I've come up w/ my own PCF but I don't know what to actually call it. Can you describe what the formula does (the MA of a MA backtest?). Thanks in advance!
XAVGC5 > XAVG(XAVGC5,3) AND XAVGC5.1 <= XAVG(XAVGC5.1,3)
and in the opposite direction is:
XAVGC5 < XAVG(XAVGC5,3) AND XAVGC5.1 >= XAVG(XAVGC5.1,3)
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
A Condtion Formula for typical price crossing its own 2-period exponential moving average with an offset of 1 in either direction can be written as:
SGN(H + L + C - XAVGH2.1 - XAVGL2.1 - XAVGC2.1) <> SGN(H1 + L1 + C1 - XAVGH2.2 - XAVGL2.2 - XAVGC2.2)
Your first Condition Formula is for the 5-period exponential moving average of the close crossing up through its own 3-period exponential moving average. Oddly enough it will return the same results as the 3-period exponential moving average of the close crossing up through the 5-period exponential moving average of the close (which is a slightly shorter way to do the same thing):
XAVGC3 > XAVGC5 AND XAVGC3.1 <= XAVGC5.1
Your second Condition Formula is for the 5-period exponential moving average of the close crossing down through its own 3-period exponential moving average. Oddly enough it will return the same results as the 3-period exponential moving average of the close crossing down through the 5-period exponential moving average of the close (which is a slightly shorter way to do the same thing):
XAVGC3 < XAVGC5 AND XAVGC3.1 >= XAVGC5.1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/3/2013 Posts: 57
|
Bruce,
Please help w/ 2 Formulas:
XAVGC3 crossing its own 2-period exponential moving average in either direction
and
DeMA 2 crossing its own 2-period exponential moving average in either direction
2 * XAVGC2 - XAVG(XAVGC2,2) ?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The XAVGC3 Condition Formula is fairly straightforward.
SGN(XAVGC3 - XAVG(XAVGC3,2) <> SGN(XAVGC3.1 - XAVG(XAVGC3.1,2)
The DEMA2 Condition Formula is quite a bit more complicated.
SGN(2 * XAVGC2 - 3 * XAVG(XAVGC2,2) + .66697164 * (XAVG(XAVGC2,2) + 1 / 3 * (XAVG(XAVGC2.1,2) + 1 / 3 * (XAVG(XAVGC2.2,2) + 1 / 3 * (XAVG(XAVGC2.3,2) + 1 / 3 * (XAVG(XAVGC2.4,2) + 1 / 3 * (XAVG(XAVGC2.5,2) + 1 / 3 * (XAVG(XAVGC2.6,2))))))))) <> SGN(2 * XAVGC2.1 - 3 * XAVG(XAVGC2.1,2) + .66697164 * (XAVG(XAVGC2.1,2) + 1 / 3 * (XAVG(XAVGC2.2,2) + 1 / 3 * (XAVG(XAVGC2.3,2) + 1 / 3 * (XAVG(XAVGC2.4,2) + 1 / 3 * (XAVG(XAVGC2.5,2) + 1 / 3 * (XAVG(XAVGC2.6,2) + 1 / 3 * (XAVG(XAVGC2.7,2)))))))))
Cascades of Moving Averages
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 794
|
Is there a way of ONLY producing candidates that are generated the FIRST time XAvgC3>
xavg(XAvgC3,2) and v>v1 are generated inversion 7 and 18?
Thank you in advance!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You can use the NOT() function to do this in both versions.
XAVGC3 > XAVG(XAVGC3, 2) AND V > V1 AND NOT(XAVGC3.1 > XAVG(XAVGC3.1, 2) AND V1 > V2)
But it could be shortened somewhat using OR if you are willing to work out the logic.
XAVGC3 > XAVG(XAVGC3, 2) AND V > V1 AND (XAVGC3.1 <= XAVG(XAVGC3.1, 2) OR V1 <= V2)
And shortened even more in TC2000 v18 using the TrueInRow() function.
TrueInRow(XAVGC3 > XAVG(XAVGC3, 2) AND V > V1, 2) = 1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 794
|
Thank you!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |