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 |

PCF Syntax Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
joginder
Posted : Friday, August 7, 2009 11:31:03 AM
Gold Customer Gold Customer

Joined: 9/26/2005
Posts: 22
Dear trainer,

Ineed a syntax for " Moving Linear Regression for 40 days < Moving Linear Regression for 84 days". Please also provide the short/simplified version of this if possible.
Many thanks.
Bruce_L
Posted : Friday, August 7, 2009 1:39:08 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The "long" form of this would be:

AVGC40 + 19.5 * (19.5 * C + 18.5 * C1 + 17.5 * C2 + 16.5 * C3 + 15.5 * C4 + 14.5 * C5 + 13.5 * C6 + 12.5 * C7 + 11.5 * C8 + 10.5 * C9 + 9.5 * C10 + 8.5 * C11 + 7.5 * C12 + 6.5 * C13 + 5.5 * C14 + 4.5 * C15 + 3.5 * C16 + 2.5 * C17 + 1.5 * C18 + .5 * C19 - .5 * C20 - 1.5 * C21 - 2.5 * C22 - 3.5 * C23 - 4.5 * C24 - 5.5 * C25 - 6.5 * C26 - 7.5 * C27 - 8.5 * C28 - 9.5 * C29 - 10.5 * C30 - 11.5 * C31 - 12.5 * C32 - 13.5 * C33 - 14.5 * C34 - 15.5 * C35 - 16.5 * C36 - 17.5 * C37 - 18.5 * C38 - 19.5 * C39) / 5330 < AVGC84 + 41.5 * (41.5 * C + 40.5 * C1 + 39.5 * C2 + 38.5 * C3 + 37.5 * C4 + 36.5 * C5 + 35.5 * C6 + 34.5 * C7 + 33.5 * C8 + 32.5 * C9 + 31.5 * C10 + 30.5 * C11 + 29.5 * C12 + 28.5 * C13 + 27.5 * C14 + 26.5 * C15 + 25.5 * C16 + 24.5 * C17 + 23.5 * C18 + 22.5 * C19 + 21.5 * C20 + 20.5 * C21 + 19.5 * C22 + 18.5 * C23 + 17.5 * C24 + 16.5 * C25 + 15.5 * C26 + 14.5 * C27 + 13.5 * C28 + 12.5 * C29 + 11.5 * C30 + 10.5 * C31 + 9.5 * C32 + 8.5 * C33 + 7.5 * C34 + 6.5 * C35 + 5.5 * C36 + 4.5 * C37 + 3.5 * C38 + 2.5 * C39 + 1.5 * C40 + .5 * C41 - .5 * C42 - 1.5 * C43 - 2.5 * C44 - 3.5 * C45 - 4.5 * C46 - 5.5 * C47 - 6.5 * C48 - 7.5 * C49 - 8.5 * C50 - 9.5 * C51 - 10.5 * C52 - 11.5 * C53 - 12.5 * C54 - 13.5 * C55 - 14.5 * C56 - 15.5 * C57 - 16.5 * C58 - 17.5 * C59 - 18.5 * C60 - 19.5 * C61 - 20.5 * C62 - 21.5 * C63 - 22.5 * C64 - 23.5 * C65 - 24.5 * C66 - 25.5 * C67 - 26.5 * C68 - 27.5 * C69 - 28.5 * C70 - 29.5 * C71 - 30.5 * C72 - 31.5 * C73 - 32.5 * C74 - 33.5 * C75 - 34.5 * C76 - 35.5 * C77 - 36.5 * C78 - 37.5 * C79 - 38.5 * C80 - 39.5 * C81 - 40.5 * C82 - 41.5 * C83) / 49385

This can be shortened somewhat to:

14509 * C + 13684 * C1 + 12859 * C2 + 12034 * C3 + 11209 * C4 + 10384 * C5 + 9559 * C6 + 8734 * C7 + 7909 * C8 + 7084 * C9 + 6259 * C10 + 5434 * C11 + 4609 * C12 + 3784 * C13 + 2959 * C14 + 2134 * C15 + 1309 * C16 + 484 * C17 + 82 * C56 + 328 * C57 + 574 * C58 + 820 * C59 + 1066 * C60 + 1312 * C61 + 1558 * C62 + 1804 * C63 + 2050 * C64 + 2296 * C65 + 2542 * C66 + 2788 * C67 + 3034 * C68 + 3280 * C69 + 3526 * C70 + 3772 * C71 + 4018 * C72 + 4264 * C73 + 4510 * C74 + 4756 * C75 + 5002 * C76 + 5248 * C77 + 5494 * C78 + 5740 * C79 + 5986 * C80 + 6232 * C81 + 6478 * C82 + 6724 * C83 < 341 * C18 + 1166 * C19 + 1991 * C20 + 2816 * C21 + 3641 * C22 + 4466 * C23 + 5291 * C24 + 6116 * C25 + 6941 * C26 + 7766 * C27 + 8591 * C28 + 9416 * C29 + 10241 * C30 + 11066 * C31 + 11891 * C32 + 12716 * C33 + 13541 * C34 + 14366 * C35 + 15191 * C36 + 16016 * C37 + 16841 * C38 + 17666 * C39 + 3854 * C40 + 3608 * C41 + 3362 * C42 + 3116 * C43 + 2870 * C44 + 2624 * C45 + 2378 * C46 + 2132 * C47 + 1886 * C48 + 1640 * C49 + 1394 * C50 + 1148 * C51 + 902 * C52 + 656 * C53 + 410 * C54 + 164 * C55

You may wish to review the following:

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

-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.