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 |

Moving Linear Regression Crossover Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
BobSoBayEnt
Posted : Tuesday, May 8, 2007 6:36:57 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 28
Is there a way to write a PCF to show when an 8 day Moving Linear Regression line is crossing over a 21 day Moving Linear Regression line? I couldn't find anything at www.tradeon.com.

Thanks.
P.S. Thanks to Craig at the Blocks seminar for pointing out how the P/E ratios are not rising with the rising stock prices. It puts things in perspective.
Bruce_L
Posted : Wednesday, May 9, 2007 9:00:40 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Please try the following:

8-Period MLR xUp 21-Period MLR:

AVGC8 + 3.5 * (3.5 * C + 2.5 * C1 + 1.5 * C2 + .5 * C3 - .5 * C4 - 1.5 * C5 - 2.5 * C6 - 3.5 * C7) / 42 > AVGC21 + 10 * (10 * C + 9 * C1 + 8 * C2 + 7 * C3 + 6 * C4 + 5 * C5 + 4 * C6 + 3 * C7 + 2 * C8 + C9 - C11 - 2 * C12 - 3 * C13 - 4 * C14 - 5 * C15 - 6 * C16 - 7 * C17 - 8 * C18 - 9 * C19 - 10 * C20) / 770 AND AVGC8.1 + 3.5 * (3.5 * C1 + 2.5 * C2 + 1.5 * C3 + .5 * C4 - .5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8) / 42 <= AVGC21.1 + 10 * (10 * C1 + 9 * C2 + 8 * C3 + 7 * C4 + 6 * C5 + 5 * C6 + 4 * C7 + 3 * C8 + 2 * C9 + C10 - C12 - 2 * C13 - 3 * C14 - 4 * C15 - 5 * C16 - 6 * C17 - 7 * C18 - 8 * C19 - 9 * C20 - 10 * C21) / 770

8-Period MLR xDown 21-Period MLR:

AVGC8 + 3.5 * (3.5 * C + 2.5 * C1 + 1.5 * C2 + .5 * C3 - .5 * C4 - 1.5 * C5 - 2.5 * C6 - 3.5 * C7) / 42 < AVGC21 + 10 * (10 * C + 9 * C1 + 8 * C2 + 7 * C3 + 6 * C4 + 5 * C5 + 4 * C6 + 3 * C7 + 2 * C8 + C9 - C11 - 2 * C12 - 3 * C13 - 4 * C14 - 5 * C15 - 6 * C16 - 7 * C17 - 8 * C18 - 9 * C19 - 10 * C20) / 770 AND AVGC8.1 + 3.5 * (3.5 * C1 + 2.5 * C2 + 1.5 * C3 + .5 * C4 - .5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8) / 42 >= AVGC21.1 + 10 * (10 * C1 + 9 * C2 + 8 * C3 + 7 * C4 + 6 * C5 + 5 * C6 + 4 * C7 + 3 * C8 + 2 * C9 + C10 - C12 - 2 * C13 - 3 * C14 - 4 * C15 - 5 * C16 - 6 * C17 - 7 * C18 - 8 * C19 - 9 * C20 - 10 * C21) / 770

8-Period MLR crossing 21-Period MLR (either direction):

SGN(AVGC8 + 3.5 * (3.5 * C + 2.5 * C1 + 1.5 * C2 + .5 * C3 - .5 * C4 - 1.5 * C5 - 2.5 * C6 - 3.5 * C7) / 42 - (AVGC21 + 10 * (10 * C + 9 * C1 + 8 * C2 + 7 * C3 + 6 * C4 + 5 * C5 + 4 * C6 + 3 * C7 + 2 * C8 + C9 - C11 - 2 * C12 - 3 * C13 - 4 * C14 - 5 * C15 - 6 * C16 - 7 * C17 - 8 * C18 - 9 * C19 - 10 * C20) / 770)) - SGN(AVGC8.1 + 3.5 * (3.5 * C1 + 2.5 * C2 + 1.5 * C3 + .5 * C4 - .5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8) / 42 - (AVGC21.1 + 10 * (10 * C1 + 9 * C2 + 8 * C3 + 7 * C4 + 6 * C5 + 5 * C6 + 4 * C7 + 3 * C8 + 2 * C9 + C10 - C12 - 2 * C13 - 3 * C14 - 4 * C15 - 5 * C16 - 6 * C17 - 7 * C18 - 8 * C19 - 9 * C20 - 10 * C21) / 770)) <> 0

You may wish to review the following:

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
Handy PCF example formulas to help you learn the syntax of PCFs!
How to create a Personal Criteria Forumula (PCF)

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
BobSoBayEnt
Posted : Wednesday, May 9, 2007 12:36:40 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 28
Thank you Bruce!
vulcan
Posted : Thursday, May 10, 2007 2:20:27 PM
Registered User
Joined: 8/7/2006
Posts: 14
I have searched for a formula for MACD line crossover close to the 0 line. The MACD parameters are slow 3, fast 18, signal 8.


thanks
Bruce_L
Posted : Thursday, May 10, 2007 3:00:00 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
vulcan,
The trainers cannot give settings, interpretation or investment advice. This includes defining "close to the 0 line" for you.

You may wish to try the following for the crossover itself:

Exponential MACD xUp Trigger:

XAVGC3 - XAVGC18 > XAVG(XAVGC3,8) - XAVG(XAVGC18,8) AND XAVGC3.1 - XAVGC18.1 <= XAVG(XAVGC3.1,8) - XAVG(XAVGC18.1,8)

Exponential MACD xDown Trigger:

XAVGC3 - XAVGC18 < XAVG(XAVGC3,8) - XAVG(XAVGC18,8) AND XAVGC3.1 - XAVGC18.1 >= XAVG(XAVGC3.1,8) - XAVG(XAVGC18.1,8)

Exponential MACD crossing Trigger (either direction):

SGN(XAVGC3 - XAVGC18 - XAVG(XAVGC3,8) + XAVG(XAVGC18,8)) - SGN(XAVGC3.1 - XAVGC18.1 - XAVG(XAVGC3.1,8) + XAVG(XAVGC18.1,8)) <> 0

Simple MACD xUp Trigger:

AVGC3 - AVGC18 > AVG(AVGC3,8) - AVG(AVGC18,8) AND AVGC3.1 - AVGC18.1 <= AVG(AVGC3.1,8) - AVG(AVGC18.1,8)

Simple MACD xDown Trigger:

AVGC3 - AVGC18 < AVG(AVGC3,8) - AVG(AVGC18,8) AND AVGC3.1 - AVGC18.1 >= AVG(AVGC3.1,8) - AVG(AVGC18.1,8)

Simple MACD crossing Trigger (either direction):

SGN(AVGC3 - AVGC18 - AVG(AVGC3,8) + AVG(AVGC18,8)) - SGN(AVGC3.1 - AVGC18.1 - AVG(AVGC3.1,8) + AVG(AVGC18.1,8)) <> 0

You may wish to review the following:

Understanding MACD
How to create a Personal Criteria Forumula (PCF)
Handy PCF example formulas to help you learn the syntax of PCFs!
Evaluating "Closeness" in PCF's - relative to Equity &/or Risk
Learn how to use the forums: post a new topic, reply, Search existing topics

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
charliegemail
Posted : Friday, May 11, 2012 9:58:09 AM
Registered User
Joined: 8/14/2011
Posts: 13

Bruce,

I was looking at the PCF you published on Moving Linear regression 8 crossing 21 period. It's quite complex, but works fine; the chart condition creator apparently isn't able to make a usable condition from two MLRs but I was interested in 8 period crossing 12 period.  Could you help me with that?

Thank you and also again for your help yesterday.

Charlie

Bruce_L
Posted : Friday, May 11, 2012 10:05:25 AM


Worden Trainer

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

 

Please try the following:
 
8-Period MLR xUp 12-Period MLR:
 
AVGC8 + 3.5 * (3.5 * C + 2.5 * C1 + 1.5 * C2 + .5 * C3 - .5 * C4 - 1.5 * C5 - 2.5 * C6 - 3.5 * C7) / 42 > AVGC12 + 5.5 * (5.5 * C + 4.5 * C1 + 3.5 * C2 + 2.5 * C3 + 1.5 * C4 + .5 * C5 - .5 * C6 - 1.5 * C7 - 2.5 * C8 - 3.5 * C9 - 4.5 * C10 - 5.5 * C11) / 143 AND AVGC8.1 + 3.5 * (3.5 * C1 + 2.5 * C2 + 1.5 * C3 + .5 * C4 - .5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8) / 42 <= AVGC12.1 + 5.5 * (5.5 * C1 + 4.5 * C2 + 3.5 * C3 + 2.5 * C4 + 1.5 * C5 + .5 * C6 - .5 * C7 - 1.5 * C8 - 2.5 * C9 - 3.5 * C10 - 4.5 * C11 - 5.5 * C12) / 143
 
8-Period MLR xDown 12-Period MLR:
 
AVGC8 + 3.5 * (3.5 * C + 2.5 * C1 + 1.5 * C2 + .5 * C3 - .5 * C4 - 1.5 * C5 - 2.5 * C6 - 3.5 * C7) / 42 < AVGC12 + 5.5 * (5.5 * C + 4.5 * C1 + 3.5 * C2 + 2.5 * C3 + 1.5 * C4 + .5 * C5 - .5 * C6 - 1.5 * C7 - 2.5 * C8 - 3.5 * C9 - 4.5 * C10 - 5.5 * C11) / 143 AND AVGC8.1 + 3.5 * (3.5 * C1 + 2.5 * C2 + 1.5 * C3 + .5 * C4 - .5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8) / 42 >= AVGC12.1 + 5.5 * (5.5 * C1 + 4.5 * C2 + 3.5 * C3 + 2.5 * C4 + 1.5 * C5 + .5 * C6 - .5 * C7 - 1.5 * C8 - 2.5 * C9 - 3.5 * C10 - 4.5 * C11 - 5.5 * C12) / 143
 
8-Period MLR crossing 12-Period MLR (either direction):
 
SGN(AVGC8 + 3.5 * (3.5 * C + 2.5 * C1 + 1.5 * C2 + .5 * C3 - .5 * C4 - 1.5 * C5 - 2.5 * C6 - 3.5 * C7) / 42 - (AVGC12 + 5.5 * (5.5 * C + 4.5 * C1 + 3.5 * C2 + 2.5 * C3 + 1.5 * C4 + .5 * C5 - .5 * C6 - 1.5 * C7 - 2.5 * C8 - 3.5 * C9 - 4.5 * C10 - 5.5 * C11) / 143)) - SGN(AVGC8.1 + 3.5 * (3.5 * C1 + 2.5 * C2 + 1.5 * C3 + .5 * C4 - .5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8) / 42 - (AVGC12.1 + 5.5 * (5.5 * C1 + 4.5 * C2 + 3.5 * C3 + 2.5 * C4 + 1.5 * C5 + .5 * C6 - .5 * C7 - 1.5 * C8 - 2.5 * C9 - 3.5 * C10 - 4.5 * C11 - 5.5 * C12) / 143)) <> 0


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
charliegemail
Posted : Friday, May 11, 2012 11:06:48 AM
Registered User
Joined: 8/14/2011
Posts: 13

Bruce,

you're amazing. I don't know how you do that so fast.

Thanks once again

Charlie

Bruce_L
Posted : Friday, May 11, 2012 11:09:47 AM


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.