Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Stochastic Moving Average Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
ehop
Posted : Tuesday, September 25, 2007 9:49:19 PM
Registered User
Joined: 11/30/2004
Posts: 33
Can I write a pcf in TC for Stoc exp (use any parameter)where SK period is crossing SD period?
Jared_C
Posted : Tuesday, September 25, 2007 10:04:41 PM

Worden Trainer

Joined: 10/7/2004
Posts: 74
Dear ehop,

After doing some research I found the following information. Please visit the link below

http://www.worden.com/training/default.aspx?g=posts&t=4726
Bruce_L
Posted : Wednesday, September 26, 2007 8:09:24 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
ehop,
One way to write crossover formulas for an Exponential Stochastic where the SK Period <> SD Period would be:

SK xUp SD:

XAVG(STOCx,y) > XAVG(STOCx,z) AND XAVG(STOCx.1.1,y) <= XAVG(STOCx.1.1,z)

SK xDown SD:

XAVG(STOCx,y) < XAVG(STOCx,z) AND XAVG(STOCx.1.1,y) >= XAVG(STOCx.1.1,z)

SK crossing SD (either direction):

SGN(XAVG(STOCx,y) - XAVG(STOCx,z)) <> SGN(XAVG(STOCx.1.1,y) - XAVG(STOCx.1.1,z))

Where:

x = Stochastic Period
y = MIN(SK Period, SD Period)
z = MAX(SK Period, SD Period)

For example, the following formulas:

SK xUp SD:

XAVG(STOC30,10) > XAVG(STOC30,20) AND XAVG(STOC30.1.1,10) <= XAVG(STOC30.1.1,20)

SK xDown SD:

XAVG(STOC30,10) < XAVG(STOC30,20) AND XAVG(STOC30.1.1,10) >= XAVG(STOC30.1.1,20)

SK crossing SD (either direction):

SGN(XAVG(STOC30,10) - XAVG(STOC30,20)) <> SGN(XAVG(STOC30.1.1,10) - XAVG(STOC30.1.1,20))

Would be correct for both Exponential Stochastic 30,20,10 and Exponential Stochastic 30,10,20.

If the SK Period = SD Period, you will need to expand at least one of the Exponential Moving Average Periods because the XAVG() function cannot be nested in TeleChart's Personal Criteria Formula Language. To give an example, the following is one way to write crossover formulas for an Exponential Stochastic 12,3,3:

SK xUp SD:

XAVG(STOC12,3) > .500488758553275 * (XAVG(STOC12,3) + .5 * (XAVG(STOC12.1.1,3) + .5 * (XAVG(STOC12.1.2,3) + .5 * (XAVG(STOC12.1.3,3) + .5 * (XAVG(STOC12.1.4,3) + .5 * (XAVG(STOC12.1.5,3) + .5 * (XAVG(STOC12.1.6,3) + .5 * (XAVG(STOC12.1.7,3) + .5 * (XAVG(STOC12.1.8,3) + .5 * (XAVG(STOC12.1.9,3))))))))))) AND XAVG(STOC12.1.1,3) <= .500488758553275 * (XAVG(STOC12.1.1,3) + .5 * (XAVG(STOC12.1.2,3) + .5 * (XAVG(STOC12.1.3,3) + .5 * (XAVG(STOC12.1.4,3) + .5 * (XAVG(STOC12.1.5,3) + .5 * (XAVG(STOC12.1.6,3) + .5 * (XAVG(STOC12.1.7,3) + .5 * (XAVG(STOC12.1.8,3) + .5 * (XAVG(STOC12.1.9,3) + .5 * (XAVG(STOC12.1.10,3)))))))))))

SK xDown SD:

XAVG(STOC12,3) < .500488758553275 * (XAVG(STOC12,3) + .5 * (XAVG(STOC12.1.1,3) + .5 * (XAVG(STOC12.1.2,3) + .5 * (XAVG(STOC12.1.3,3) + .5 * (XAVG(STOC12.1.4,3) + .5 * (XAVG(STOC12.1.5,3) + .5 * (XAVG(STOC12.1.6,3) + .5 * (XAVG(STOC12.1.7,3) + .5 * (XAVG(STOC12.1.8,3) + .5 * (XAVG(STOC12.1.9,3))))))))))) AND XAVG(STOC12.1.1,3) >= .500488758553275 * (XAVG(STOC12.1.1,3) + .5 * (XAVG(STOC12.1.2,3) + .5 * (XAVG(STOC12.1.3,3) + .5 * (XAVG(STOC12.1.4,3) + .5 * (XAVG(STOC12.1.5,3) + .5 * (XAVG(STOC12.1.6,3) + .5 * (XAVG(STOC12.1.7,3) + .5 * (XAVG(STOC12.1.8,3) + .5 * (XAVG(STOC12.1.9,3) + .5 * (XAVG(STOC12.1.10,3)))))))))))

SK crossing SD (either direction):

SGN(XAVG(STOC12,3) - .500488758553275 * (XAVG(STOC12,3) + .5 * (XAVG(STOC12.1.1,3) + .5 * (XAVG(STOC12.1.2,3) + .5 * (XAVG(STOC12.1.3,3) + .5 * (XAVG(STOC12.1.4,3) + .5 * (XAVG(STOC12.1.5,3) + .5 * (XAVG(STOC12.1.6,3) + .5 * (XAVG(STOC12.1.7,3) + .5 * (XAVG(STOC12.1.8,3) + .5 * (XAVG(STOC12.1.9,3)))))))))))) <> SGN(XAVG(STOC12.1.1,3) >= .500488758553275 * (XAVG(STOC12.1.1,3) + .5 * (XAVG(STOC12.1.2,3) + .5 * (XAVG(STOC12.1.3,3) + .5 * (XAVG(STOC12.1.4,3) + .5 * (XAVG(STOC12.1.5,3) + .5 * (XAVG(STOC12.1.6,3) + .5 * (XAVG(STOC12.1.7,3) + .5 * (XAVG(STOC12.1.8,3) + .5 * (XAVG(STOC12.1.9,3) + .5 * (XAVG(STOC12.1.10,3))))))))))))

You may wish to review the following:

How to create a Personal Criteria Forumula (PCF)
Understanding Stochastics
Cascades of Moving Averages
Handy PCF example formulas to help you learn the syntax of PCFs!
PCF Formula Descriptions

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