Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

mov avg of indicator Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Laufman
Posted : Sunday, August 31, 2008 12:39:27 PM
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
Bruce_L
Posted : Tuesday, September 02, 2008 9:01:19 AM


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
stochastics
Posted : Thursday, January 16, 2014 10:46:00 PM
Gold Customer Gold Customer

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) 

Bruce_L
Posted : Friday, January 17, 2014 9:53:45 AM


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
stochastics
Posted : Friday, November 20, 2015 12:58:18 AM
Gold Customer Gold Customer

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) ?
 
Bruce_L
Posted : Friday, November 20, 2015 8:40:17 AM


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
Quiktdr
Posted : Tuesday, March 26, 2019 11:43:08 AM
Platinum Customer Platinum Customer

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!

 

Bruce_L
Posted : Tuesday, March 26, 2019 12:12:20 PM


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
Quiktdr
Posted : Tuesday, March 26, 2019 12:45:00 PM
Platinum Customer Platinum Customer

Joined: 10/7/2004
Posts: 794

Thank you!

Bruce_L
Posted : Tuesday, March 26, 2019 12:52:40 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.