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

Stochastics cross over just today Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
zellsman
Posted : Thursday, March 2, 2006 6:49:06 PM
Registered User
Joined: 10/7/2004
Posts: 63
Hello
I'm looking for a 543 stochastic PCF where the fast is just crossing the slow just today to the upside. Also to the downside. Here is one I had been using I thought just fine, but now I get false results.
(STOC5.4.1) < (AVG(STOC5.4.1,3) AND (STOC5.4)) > (AVG(STOC5.4,3))

Thanks for any help
Chuck
Craig_S
Posted : Thursday, March 2, 2006 7:05:57 PM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
Here is how I would write it:

STOC5.4.1<AVG(STOC5.4.1,3) AND STOC5.4>AVG(STOC5.4,3)

You say it use to work but is now giving false results?

Delete it and replace it with my version and see if it fixes things.


- Craig
Here to Help!
zellsman
Posted : Thursday, March 2, 2006 8:09:15 PM
Registered User
Joined: 10/7/2004
Posts: 63
Thanks Craig
Anyway to make it Exponential??
Thanks
Chuck
Bruce_L
Posted : Friday, March 3, 2006 10:30:07 AM


Worden Trainer

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

XAVG(STOC5.1.1,4) < .500488758553275 * (XAVG(STOC5.1.1,4) + .5 * (XAVG(STOC5.1.2,4) + .5 * (XAVG(STOC5.1.3,4) + .5 * (XAVG(STOC5.1.4,4) + .5 * (XAVG(STOC5.1.5,4) + .5 * (XAVG(STOC5.1.6,4) + .5 * (XAVG(STOC5.1.7,4) + .5 * (XAVG(STOC5.1.8,4) + .5 * (XAVG(STOC5.1.9,4) + .5 * (XAVG(STOC5.1.10,4))))))))))) AND XAVG(STOC5.1,4) > .500488758553275 * (XAVG(STOC5.1,4) + .5 * (XAVG(STOC5.1.1,4) + .5 * (XAVG(STOC5.1.2,4) + .5 * (XAVG(STOC5.1.3,4) + .5 * (XAVG(STOC5.1.4,4) + .5 * (XAVG(STOC5.1.5,4) + .5 * (XAVG(STOC5.1.6,4) + .5 * (XAVG(STOC5.1.7,4) + .5 * (XAVG(STOC5.1.8,4) + .5 * (XAVG(STOC5.1.9,4)))))))))))

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
zellsman
Posted : Sunday, March 5, 2006 2:38:04 PM
Registered User
Joined: 10/7/2004
Posts: 63
Craig and Bruce
Thank you both very much. I find writing PCF's very hard.
Thanks
Chuck
Quiktdr
Posted : Tuesday, September 16, 2008 7:19:48 PM
Registered User
Joined: 10/7/2004
Posts: 794



How would one write the above PCF for exponential  Stochastics 5.2.2  instead of 5,4,3.

 

Thank you in advance!

Bruce_L
Posted : Wednesday, September 17, 2008 7:51:32 AM


Worden Trainer

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

Exponential Stochastic 5,2,2 SK xUp SD:

XAVG(STOC5,2) > .666971637694419 * (XAVG(STOC5,2) + 1 / 3 * (XAVG(STOC5.1.1,2) + 1 / 3 * (XAVG(STOC5.1.2,2) + 1 / 3 * (XAVG(STOC5.1.3,2) + 1 / 3 * (XAVG(STOC5.1.4,2) + 1 / 3 * (XAVG(STOC5.1.5,2) + 1 / 3 * (XAVG(STOC5.1.6,2)))))))) AND XAVG(STOC5.1.1,2) <= .666971637694419 * (XAVG(STOC5.1.1,2) + 1 / 3 * (XAVG(STOC5.1.2,2) + 1 / 3 * (XAVG(STOC5.1.3,2) + 1 / 3 * (XAVG(STOC5.1.4,2) + 1 / 3 * (XAVG(STOC5.1.5,2) + 1 / 3 * (XAVG(STOC5.1.6,2) + 1 / 3 * (XAVG(STOC5.1.7,2))))))))

On another note, the Personal Criteria Formula I provided in my Friday, March 03, 2006 10:30:07 AM ET post can be dramatically shortened to:

Exponential Stochastic 5,4,3 SK xUp SD:

XAVG(STOC5,4) < XAVG(STOC5,3) AND XAVG(STOC5.1.1,4) >= XAVG(STOC5.1.1,3)

You may wish to review the following:

Understanding Stochastics
Cascades of Moving Averages
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
Quiktdr
Posted : Wednesday, September 17, 2008 8:13:56 AM
Registered User
Joined: 10/7/2004
Posts: 794
Bruce,

Thank you, you continue to offer amazing and fast answers.

I appreciate it very much!
Bruce_L
Posted : Wednesday, September 17, 2008 8:21:59 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Quiktdr,
You're welcome. Our pleasure.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Quiktdr
Posted : Wednesday, September 17, 2008 8:42:34 AM
Registered User
Joined: 10/7/2004
Posts: 794
One problem, I split your PCF at the "and" in order to get a cross up PCF and a cross down PCF yet when I separate the two PCF's and put them on left of chart they both read true.

UP     XAVG(STOC5,2) > .666971637694419 * (XAVG(STOC5,2) + 1 / 3 * (XAVG(STOC5.1.1,2) + 1 / 3 * (XAVG(STOC5.1.2,2) + 1 / 3 * (XAVG(STOC5.1.3,2) + 1 / 3 * (XAVG(STOC5.1.4,2) + 1 / 3 * (XAVG(STOC5.1.5,2) + 1 / 3 * (XAVG(STOC5.1.6,2)))))))) 


DOWN    XAVG(STOC5.1.1,2) <= .666971637694419 * (XAVG(STOC5.1.1,2) + 1 / 3 * (XAVG(STOC5.1.2,2) + 1 / 3 * (XAVG(STOC5.1.3,2) + 1 / 3 * (XAVG(STOC5.1.4,2) + 1 / 3 * (XAVG(STOC5.1.5,2) + 1 / 3 * (XAVG(STOC5.1.6,2) + 1 / 3 * (XAVG(STOC5.1.7,2))))))))


Obviously, a stock cannot be both crossing up and down in the same stock at EOD

Comments?
Bruce_L
Posted : Wednesday, September 17, 2008 9:03:05 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Quiktdr,
A crossover formula involves two comparisons. One to test if the something is above or below during the current bar and another to test if the something is the opposite on the previous bar.

Your "Up" portion isn't checking for a crossover, it is just checking for for the SK to above the SD on the current bar.

Your "Down" portion isn't checking for a crossover either. It is just checking for the SK to be at or below the SD on the previous bar.

It is only when these two conditions are combined with an AND that you have a formula to check for the SK crossing up through the SD.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Quiktdr
Posted : Wednesday, September 17, 2008 9:11:07 AM
Registered User
Joined: 10/7/2004
Posts: 794
Okay, Thank you

Is there a way of writing two separate PCF's for cross up and cross down?
Bruce_L
Posted : Wednesday, September 17, 2008 9:12:29 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Quikttdr,
If you want a crossdown formula, you would reverse the > and < signs:

Exponential Stochastic 5,2,2 SK xDn SD:

XAVG(STOC5,2) < .666971637694419 * (XAVG(STOC5,2) + 1 / 3 * (XAVG(STOC5.1.1,2) + 1 / 3 * (XAVG(STOC5.1.2,2) + 1 / 3 * (XAVG(STOC5.1.3,2) + 1 / 3 * (XAVG(STOC5.1.4,2) + 1 / 3 * (XAVG(STOC5.1.5,2) + 1 / 3 * (XAVG(STOC5.1.6,2)))))))) AND XAVG(STOC5.1.1,2) >= .666971637694419 * (XAVG(STOC5.1.1,2) + 1 / 3 * (XAVG(STOC5.1.2,2) + 1 / 3 * (XAVG(STOC5.1.3,2) + 1 / 3 * (XAVG(STOC5.1.4,2) + 1 / 3 * (XAVG(STOC5.1.5,2) + 1 / 3 * (XAVG(STOC5.1.6,2) + 1 / 3 * (XAVG(STOC5.1.7,2))))))))

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Quiktdr
Posted : Wednesday, September 17, 2008 9:20:11 AM
Registered User
Joined: 10/7/2004
Posts: 794
Bruce,


Duh that's right sorry brainfreeze
Bruce_L
Posted : Wednesday, September 17, 2008 9:23:01 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Quiktdr,
I frequently forget stuff that I "know" and have done a bunch of times. I think it is just part of the human condition (although in my case, it could be that I'm getting old). The fact that it was a long complicated formula doesn't help much either. It makes it hard to see the forest for the trees.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Quiktdr
Posted : Wednesday, September 17, 2008 9:59:32 AM
Registered User
Joined: 10/7/2004
Posts: 794
Bruce,

You are too kind,

Thank you for your assistance in overcoming my "DUH" moment
Bruce_L
Posted : Wednesday, September 17, 2008 10:07:40 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Quiktdr,
You're welcome. Our pleasure.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Quiktdr
Posted : Monday, July 13, 2009 3:11:42 PM
Registered User
Joined: 10/7/2004
Posts: 794
How would one write a Exponential Stochastic 3,2,3 SK x Dn SD today?
Bruce_L
Posted : Monday, July 13, 2009 3:16:54 PM


Worden Trainer

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

XAVG(STOC3,3) > XAVG(STOC3,2) AND XAVG(STOC3.1.1,3) <= XAVG(STOC3.1.1,2)

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Quiktdr
Posted : Tuesday, July 14, 2009 10:05:15 AM
Registered User
Joined: 10/7/2004
Posts: 794
Bruce,


After inputting the attached code, it does not generate candidates that just crossed today.

Am I doing something wrong or is this formula  detecting some other relationship?

XAVG(STOC3,3) > XAVG(STOC3,2) AND XAVG(STOC3.1.1,3) <= XAVG(STOC3.1.1,2)
 I am looking for two formulas one for up cross and the other for down cross today ( for use post close).

Therefore every candidate that I scan after the close should have a fresh cross today.

TY in advance!
Bruce_L
Posted : Tuesday, July 14, 2009 10:12:25 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Quiktdr,
Please provide examples. The formula given above exactly matches where the SK crosses down the SD for a Daily Exponential Stochastic 3,2,3 on my computer. The crossup formula would be:

XAVG(STOC3,3) < XAVG(STOC3,2) AND XAVG(STOC3.1.1,3) >= XAVG(STOC3.1.1,2)

A formula detecting crossovers in either direction would be:

SGN(XAVG(STOC3,3) - XAVG(STOC3,2)) <> SGN(XAVG(STOC3.1.1,3) - XAVG(STOC3.1.1,2))

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Quiktdr
Posted : Tuesday, July 14, 2009 12:01:10 PM
Registered User
Joined: 10/7/2004
Posts: 794

Bruce,

I used the attached code and

{STO323 XD TDY} XAVG(STOC3,3) < XAVG(STOC3,2) AND XAVG(STOC3.1.1,3) >= XAVG(STOC3.1.1,2)

and added Price per Share 19.96 to 19.96 rank 66 to66
  I generated 11 candidates;  ARTNA CPV EML EWL FCFS IVC MLN SRCE THO TRCR WCG

I am looking for 1st day of crossover which would be last night's close (071309)


ARTNA crossover up 071009  not 071309
CPV     X  up  0713
EML    X up  0713
EWL crossover 070909 X up not 0713
FCFS   X  up
IVC   X  up
MLN x down   okay
SRCE  x UP
THO   X UP
TRCR     NO CROSS
WCG     CROSS  up

Judging by these results not only does the formula seem to be flipped but it is inconsistent.  Maybe I am missing something or not explaing what I am looking for correctly.

TY

Bruce_L
Posted : Tuesday, July 14, 2009 12:47:32 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (Quiktdr)
{STO323 XD TDY} XAVG(STOC3,3) < XAVG(STOC3,2) AND XAVG(STOC3.1.1,3) >= XAVG(STOC3.1.1,2)

The formula given in your Tuesday, July 14, 2009 12:01:10 PM ET post is the crossup formula given in my Tuesday, July 14, 2009 10:12:25 AM ET post, not the crossdown formula given in my Monday, July 13, 2009 3:16:54 PM ET post.

QUOTE (Quiktdr)
Judging by these results not only does the formula seem to be flipped but it is inconsistent.  Maybe I am missing something or not explaing what I am looking for correctly.

Are you sure you have a Daily Exponential Stochastic 3,2,3? All of the examples given seem to have crossed up on July 13, 2009.

ARTNA SK: 20.40 < SD: 21.38 on 7/10/2009 and SK: 69.84 > SD: 45.61 on 7/13/2009.
CPV SK: 44.95 < SD: 47.16 on 7/10/2009 and SK: 74.71 > SD: 60.93 on 7/13/2009.
EML SK: 17.11 < SD: 26.98 on 7/10/2009 and SK: 67.61 > SD: 47.29 on 7/13/2009.
EWL SK: 47.21 < SD: 47.27 on 7/10/2009 and SK: 75.74 > SD: 61.51 on 7/13/2009.
FCFS SK: 26.19 < SD: 31.14 on 7/10/2009 and SK: 61.67 > SD: 46.41 on 7/13/2009.
IVC SK: 35.54 < SD: 37.33 on 7/10/2009 and SK: 78.51 > SD: 57.92 on 7/13/2009.
MLN SK: 67.25 < SD: 67.61 on 7/10/2009 and SK: 73.70 > SD: 70.65 on 7/13/2009.
SRCE SK: 16.24 < SD: 20.11 on 7/10/2009 and SK: 59.89 > SD: 40.00 on 7/13/2009.
THO SK: 27.22 < SD: 30.46 on 7/10/2009 and SK: 64.28 > SD: 47.38 on 7/13/2009.
TRCR SK: 72.42 < SD: 76.54 on 7/10/2009 and SK: 79.69 > SD: 78.11 on 7/13/2009.
WCG SK: 30.73 < SD: 32.28 on 7/10/2009 and SK: 53.23 > SD: 42.74 on 7/13/2009.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Quiktdr
Posted : Tuesday, July 14, 2009 3:36:50 PM
Registered User
Joined: 10/7/2004
Posts: 794
Bruce,


When I visually analyze daily charts all of the charts "show" the crosses as I indicated.

This is a mystery to me.

I am using the codes exactly as previous messages.
Quiktdr
Posted : Tuesday, July 14, 2009 3:45:06 PM
Registered User
Joined: 10/7/2004
Posts: 794

Bruce,


I see the problem, I had simple checked instead of ema


TY for your help!

Bruce_L
Posted : Tuesday, July 14, 2009 3:50:40 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Quiktdr,
You're welcome. I'm happy to read you were able to figure it out. The formulas for a Simple Stochastic 3,2,3 would be:

Simple Stochastic 3,2,3 SK xUp SD:

STOC3.2 > AVG(STOC3.2,3) AND STOC3.2.1 <= AVG(STOC3.2.1,3)

Simple Stochastic 3,2,3 SK xDn SD:

STOC3.2 < AVG(STOC3.2,3) AND STOC3.2.1 >= AVG(STOC3.2.1,3)

Simple Stochastic 3,2,3 SK Crossing SD (either direction):

SGN(STOC3.2 - AVG(STOC3.2,3)) <> SGN(STOC3.2.1 - AVG(STOC3.2.1,3))

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
twobben15
Posted : Tuesday, July 14, 2009 6:55:18 PM
Registered User
Joined: 7/8/2009
Posts: 8
Hi Bruce,

If I wanted to do this for a Simple Stochastic 14,3,3 would I just substitute 14 for 3, 3 for 2, and 3 for 3, in your PCFs below ?

Thanks in advance.


QUOTE (Bruce_L)
Quiktdr,
You're welcome. I'm happy to read you were able to figure it out. The formulas for a Simple Stochastic 3,2,3 would be:

Simple Stochastic 3,2,3 SK xUp SD:

STOC3.2 > AVG(STOC3.2,3) AND STOC3.2.1 <= AVG(STOC3.2.1,3)

Simple Stochastic 3,2,3 SK xDn SD:

STOC3.2 < AVG(STOC3.2,3) AND STOC3.2.1 >= AVG(STOC3.2.1,3)

Simple Stochastic 3,2,3 SK Crossing SD (either direction):

SGN(STOC3.2 - AVG(STOC3.2,3)) <> SGN(STOC3.2.1 - AVG(STOC3.2.1,3))
Bruce_L
Posted : Wednesday, July 15, 2009 8:03:38 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
twobben15,
Yes. This is somewhat ambiguous however as the 3 occurs as both the Stochastic Period and as the SD Period in the example (although I'm suspecting you would probably get the replacements right). The result would be:

Simple Stochastic 14,3,3 SK xUp SD:

STOC14.3 > AVG(STOC14.3,3) AND STOC14.3.1 <= AVG(STOC14.3.1,3)

Simple Stochastic 14,3,3 SK xDn SD:

STOC14.3 < AVG(STOC14.3,3) AND STOC14.3.1 >= AVG(STOC14.3.1,3)

Simple Stochastic 14,3,3 SK Crossing SD (either direction):

SGN(STOC14.3 - AVG(STOC14.3,3)) <> SGN(STOC14.3.1 - AVG(STOC14.3.1,3))

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
sloop22
Posted : Monday, December 28, 2009 11:50:25 AM
Registered User
Joined: 12/5/2007
Posts: 29

Gentlemen

In this PCF 
Simple example STOC9.3,3 >=25 and Stoc9.3,3<=50 works fine for the daily chart.
 Shows up fine, right in the middle.

I understand the concept and have gone through all the discussions, but for the life of me, how do you get this to work on a weekly chart, I know I must be missing something very simple. 

my appreciation and thanks in advance

Bruce_L
Posted : Monday, December 28, 2009 12:04:59 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (sloop22)
In this PCF 
Simple example STOC9.3,3 >=25 and Stoc9.3,3<=50 works fine for the daily chart.
 Shows up fine, right in the middle.

While it might seem to be doing what you want, it is not valid syntax. If you are interested in the SK, it should look more like:

STOC9.3 >= 25 AND STOC9.3 <= 50

If you are interested in the SD, it should look more like:

AVG(STOC9.3,3) >= 25 AND AVG(STOC9.3,3) <= 50

QUOTE (sloop22)
I understand the concept and have gone through all the discussions, but for the life of me, how do you get this to work on a weekly chart, I know I must be missing something very simple.

I'm not sure if it is "simple" or not.

Personal Criteria Formulas are always based on Daily data, so to convert it to Weekly, you need to multiply the base period of the Stochastic by 5 (the number of Trading Days in a Weekly Bar) and then take the appropriate Moving Averages on a Weekly basis (meaning you need to sample the base value once every 5-Trading Days).

So if you are interested in the SK, the Weekly version should look something like:

(STOC45 + STOC45.1.5 + STOC45.1.10) / 3 >= 25 AND (STOC45 + STOC45.1.5 + STOC45.1.10) / 3 <= 50

So if you are interested in the SD, the Weekly version should look something like:

(STOC45 + 2 * STOC45.1.5 + 3 * STOC45.1.10 + 2 * STOC45.1.15 + STOC45.1.20) / 9 >= 25 AND (STOC45 + 2 * STOC45.1.5 + 3 * STOC45.1.10 + 2 * STOC45.1.15 + STOC45.1.20) / 9 <= 50

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
sloop22
Posted : Monday, December 28, 2009 12:18:18 PM
Registered User
Joined: 12/5/2007
Posts: 29
Bruce, thank you very much for your response.

Personal Criteria Formulas are always based on Daily data, so to convert it to Weekly, you need to multiply the base period of the Stochastic by 5 (the number of Trading Days in a Weekly Bar) and then take the appropriate Moving Averages on a Weekly basis (meaning you need to sample the base value once every 5-Trading Days).


I'm not a real math guy, however you have answered my question without me being able to ask it in the proper manner. You have pointed me in the right direction.

Great job, 
Thank You
Jeff  
Bruce_L
Posted : Monday, December 28, 2009 12:48:33 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
sloop22,
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stentoner
Posted : Saturday, January 2, 2010 1:58:18 PM
Gold Customer Gold Customer

Joined: 3/23/2005
Posts: 4
Bruce,
You might not be wanting to discuss weekly stochs this new year after so many previous posts. I'm trying to understand conceptually several things:
1. Is StocX = StochX.1, where X= any integer? I thought StocX is the "raw" stoch today.
2. Where do the mutipliers in exp. averages come from? ie. 500488758553275, .
.333559032545198. (This is from your example of %K crossing up through %D below the 40 line). It appears you're converting a stoc12.3 into weekly, exponential average.
3. I'm converting a 25.8.8 into weekly exponential, %K crossing up/down %D (though simple average seems to capture LT stock trends almost as well). Here's the posted example I'm using for simple average (my brackets):
%K is crossing up through %D below the 40 line.
{(STOC60 + STOC60.1.5 + STOC60.1.10) / 3 < 40} AND {4 * STOC60 + 3 * STOC60.1.5 + 2 * STOC60.1.10 > 3 * STOC60.1.15 + 3 * STOC60.1.20 + 2 * STOC60.1.25 + STOC60.1.30} AND{ 4 * STOC60.1.5 + 3 * STOC60.1.10 + 2 * STOC60.1.15 <= 3 * STOC60.1.20 + 3 * STOC60.1.25 + 2 * STOC60.1.30 + STOC60.1.35}

1. The first {} test for below 40. Three factors correspond to 3 day period??
2. The second {} test today %K above %D. Q: Whence the multipliers 4,3,2 and 3,3,2,1?
Why does first part have 3 factors (multiplied by 4,3,2) and the second part 4 factors? In my PCF, period = 8 daily (40 weekly), what multipliers?
3. The third {} test yesterday %K below %D. Same questions?
4. For exponentials, whence the multipliers and number of factors?
Any insight you could provide would greatly help! Thanks.
 -- Steve
Bruce_L
Posted : Monday, January 4, 2010 5:48:15 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
stentoner,
Welcome to the forums. A very good foundation for learning how to use TeleChart can be gained by reviewing the following:

If you are new to TeleChart READ THIS FIRST!

QUOTE (stentoner)
1. Is StocX = StochX.1, where X= any integer? I thought StocX is the "raw" stoch today.

It is the same (well except for the h in Stochx.1 which would result in a syntax error). The y in STOCx.y.z is a the Period of a Simple Moving Average. A 1-Period Moving Average of something is the same as that something.

PCF Formula Descriptions

QUOTE (stentoner)
2. Where do the mutipliers in exp. averages come from? ie. .500488758553275, . .333559032545198. (This is from your example of %K crossing up through %D below the 40 line). It appears you're converting a stoc12.3 into weekly, exponential average.
...
4. For exponentials, whence the multipliers and number of factors?

The Exponential Moving Average formulas are approximations that can use a limited number of terms because the contributions of older values become more insignificant the further back you go. You could use 1/2 or 1/3 but since we aren't using an infinite number of terms the results would be ever slightly too small. You want the sum of the factors to equal 1, so you need to make the factors slightly bigger to make the correction. The following topics should provide more details on the technique used.

Exponential moving averages of formulas in pcfs
Cascades of Moving Averages

QUOTE (stentoner)
1. The first {} test for below 40. Three factors correspond to 3 day period??

Yes. We would be calculating a 3-Period Simple Moving Average which involves adding together 3-Values and dividing by 3.

Understanding Stochastics

QUOTE (stentoner)
2. The second {} test today %K above %D. Q: Whence the multipliers 4,3,2 and 3,3,2,1? Why does first part have 3 factors (multiplied by 4,3,2) and the second part 4 factors?

It's just a result of simplifying a longer formula. I'm assuming the above is for a Weekly Simple Stochastic 12,3,5. If you start with something like the following for the SK being above the SD:

(STOC60.1.0 + STOC60.1.5 + STOC60.1.10) / 3 > ((STOC60.1.0 + STOC60.1.5 + STOC60.1.10) / 3 + (STOC60.1.5 + STOC60.1.10 + STOC60.1.15) / 3 + (STOC60.1.10 + STOC60.1.15 + STOC60.1.20) / 3 + (STOC60.1.15 + STOC60.1.20 + STOC60.1.25) / 3 + (STOC60.1.20 + STOC60.1.25 + STOC60.1.30) / 3) / 5

You end up with something shorter by combining terms and getting rid of the fractions:

4 * STOC60 + 3 * STOC60.1.5 + 2 * STOC60.1.10 > 3 * STOC60.1.15 + 3 * STOC60.1.20 + 2 * STOC60.1.25 + STOC60.1.30

QUOTE (stentoner)
In my PCF, period = 8 daily (40 weekly), what multipliers?

If it were a Simple Weekly Stochastic 25,8,8, a formula for the SK being above the SD could be written as:

(STOC125.1.0 + STOC125.1.5 + STOC125.1.10 + STOC125.1.15 + STOC125.1.20 + STOC125.1.25 + STOC125.1.30 + STOC125.1.35) / 8 > ((STOC125.1.0 + STOC125.1.5 + STOC125.1.10 + STOC125.1.15 + STOC125.1.20 + STOC125.1.25 + STOC125.1.30 + STOC125.1.35) / 8 + (STOC125.1.5 + STOC125.1.10 + STOC125.1.15 + STOC125.1.20 + STOC125.1.25 + STOC125.1.30 + STOC125.1.35 + STOC125.1.40) / 8 + (STOC125.1.10 + STOC125.1.15 + STOC125.1.20 + STOC125.1.25 + STOC125.1.30 + STOC125.1.35 + STOC125.1.40 + STOC125.1.45) / 8 + (STOC125.1.15 + STOC125.1.20 + STOC125.1.25 + STOC125.1.30 + STOC125.1.35 + STOC125.1.40 + STOC125.1.45 + STOC125.1.50) / 8 + (STOC125.1.20 + STOC125.1.25 + STOC125.1.30 + STOC125.1.35 + STOC125.1.40 + STOC125.1.45 + STOC125.1.50 + STOC125.1.55) / 8 + (STOC125.1.25 + STOC125.1.30 + STOC125.1.35 + STOC125.1.40 + STOC125.1.45 + STOC125.1.50 + STOC125.1.55 + STOC125.1.60) / 8 + (STOC125.1.30 + STOC125.1.35 + STOC125.1.40 + STOC125.1.45 + STOC125.1.50 + STOC125.1.55 + STOC125.1.60 + STOC125.1.65) / 8 + (STOC125.1.35 + STOC125.1.40 + STOC125.1.45 + STOC125.1.50 + STOC125.1.55 + STOC125.1.60 + STOC125.1.65 + STOC125.1.70) / 8) / 8

Which could be shortened into:

7 * STOC125 + 6 * STOC125.1.5 + 5 * STOC125.1.10 + 4 * STOC125.1.15 + 3 * STOC125.1.20 + 2 * STOC125.1.25 + STOC125.1.30 > 7 * STOC125.1.40 + 6 * STOC125.1.45 + 5 * STOC125.1.50 + 4 * STOC125.1.55 + 3 * STOC125.1.60 + 2 * STOC125.1.65 + STOC125.1.70

But since it is Exponential:

.222417712077508 * (STOC125 + 7 / 9 * (STOC125.1.5 + 7 / 9 * (STOC125.1.10 + 7 / 9 * (STOC125.1.15 + 7 / 9 * (STOC125.1.20 + 7 / 9 * (STOC125.1.25 + 7 / 9 * (STOC125.1.30 + 7 / 9 * (STOC125.1.35 + 7 / 9 * (STOC125.1.40 + 7 / 9 * (STOC125.1.45 + 7 / 9 * (STOC125.1.50 + 7 / 9 * (STOC125.1.55 + 7 / 9 * (STOC125.1.60 + 7 / 9 * (STOC125.1.65 + 7 / 9 * (STOC125.1.70 + 7 / 9 * (STOC125.1.75 + 7 / 9 * (STOC125.1.80 + 7 / 9 * (STOC125.1.85 + 7 / 9 * (STOC125.1.90 + 7 / 9 * (STOC125.1.95 + 7 / 9 * (STOC125.1.100 + 7 / 9 * (STOC125.1.105 + 7 / 9 * (STOC125.1.110 + 7 / 9 * (STOC125.1.115 + 7 / 9 * (STOC125.1.120 + 7 / 9 * (STOC125.1.125 + 7 / 9 * (STOC125.1.130 + 7 / 9 * (STOC125.1.135)))))))))))))))))))))))))))) > .0494244444760955 * (STOC125 + 7 / 9 * (2 * STOC125.1.5 + 7 / 9 * (3 * STOC125.1.10 + 7 / 9 * (4 * STOC125.1.15 + 7 / 9 * (5 * STOC125.1.20 + 7 / 9 * (6 * STOC125.1.25 + 7 / 9 * (7 * STOC125.1.30 + 7 / 9 * (8 * STOC125.1.35 + 7 / 9 * (9 * STOC125.1.40 + 7 / 9 * (10 * STOC125.1.45 + 7 / 9 * (11 * STOC125.1.50 + 7 / 9 * (12 * STOC125.1.55 + 7 / 9 * (13 * STOC125.1.60 + 7 / 9 * (14 * STOC125.1.65 + 7 / 9 * (15 * STOC125.1.70 + 7 / 9 * (16 * STOC125.1.75 + 7 / 9 * (17 * STOC125.1.80 + 7 / 9 * (18 * STOC125.1.85 + 7 / 9 * (19 * STOC125.1.90 + 7 / 9 * (20 * STOC125.1.95 + 7 / 9 * (21 * STOC125.1.100 + 7 / 9 * (22 * STOC125.1.105 + 7 / 9 * (23 * STOC125.1.110 + 7 / 9 * (24 * STOC125.1.115 + 7 / 9 * (25 * STOC125.1.120 + 7 / 9 * (26 * STOC125.1.125 + 7 / 9 * (27 * STOC125.1.130 + 7 / 9 * (28 * STOC125.1.135 + 7 / 9 * (29 * STOC125.1.140 + 7 / 9 * (30 * STOC125.1.145 + 7 / 9 * (31 * STOC125.1.150 + 7 / 9 * (32 * STOC125.1.155 + 7 / 9 * (33 * STOC125.1.160 + 7 / 9 * (34 * STOC125.1.165 + 7 / 9 * (35 * STOC125.1.170 + 7 / 9 * (36 * STOC125.1.175 + 7 / 9 * (37 * STOC125.1.180)))))))))))))))))))))))))))))))))))))

QUOTE (stentoner)
3. The third {} test yesterday %K below %D. Same questions?

Just add 5 (the number of Trading Days in a Weekly Bar in TeleChart) to all of the Bars Ago parameters and change the > to a <:

Simple:

7 * STOC125.1.5 + 6 * STOC125.1.10 + 5 * STOC125.1.15 + 4 * STOC125.1.20 + 3 * STOC125.1.25 + 2 * STOC125.1.30 + STOC125.1.35 < 7 * STOC125.1.45 + 6 * STOC125.1.50 + 5 * STOC125.1.55 + 4 * STOC125.1.60 + 3 * STOC125.1.65 + 2 * STOC125.1.70 + STOC125.1.75

Exponential:

.222417712077508 * (STOC125.1.5 + 7 / 9 * (STOC125.1.10 + 7 / 9 * (STOC125.1.15 + 7 / 9 * (STOC125.1.20 + 7 / 9 * (STOC125.1.25 + 7 / 9 * (STOC125.1.30 + 7 / 9 * (STOC125.1.35 + 7 / 9 * (STOC125.1.40 + 7 / 9 * (STOC125.1.45 + 7 / 9 * (STOC125.1.50 + 7 / 9 * (STOC125.1.55 + 7 / 9 * (STOC125.1.60 + 7 / 9 * (STOC125.1.65 + 7 / 9 * (STOC125.1.70 + 7 / 9 * (STOC125.1.75 + 7 / 9 * (STOC125.1.80 + 7 / 9 * (STOC125.1.85 + 7 / 9 * (STOC125.1.90 + 7 / 9 * (STOC125.1.95 + 7 / 9 * (STOC125.1.100 + 7 / 9 * (STOC125.1.105 + 7 / 9 * (STOC125.1.110 + 7 / 9 * (STOC125.1.115 + 7 / 9 * (STOC125.1.120 + 7 / 9 * (STOC125.1.125 + 7 / 9 * (STOC125.1.130 + 7 / 9 * (STOC125.1.135 + 7 / 9 * (STOC125.1.140)))))))))))))))))))))))))))) < .0494244444760955 * (STOC125.1.5 + 7 / 9 * (2 * STOC125.1.10 + 7 / 9 * (3 * STOC125.1.15 + 7 / 9 * (4 * STOC125.1.20 + 7 / 9 * (5 * STOC125.1.25 + 7 / 9 * (6 * STOC125.1.30 + 7 / 9 * (7 * STOC125.1.35 + 7 / 9 * (8 * STOC125.1.40 + 7 / 9 * (9 * STOC125.1.45 + 7 / 9 * (10 * STOC125.1.50 + 7 / 9 * (11 * STOC125.1.55 + 7 / 9 * (12 * STOC125.1.60 + 7 / 9 * (13 * STOC125.1.65 + 7 / 9 * (14 * STOC125.1.70 + 7 / 9 * (15 * STOC125.1.75 + 7 / 9 * (16 * STOC125.1.80 + 7 / 9 * (17 * STOC125.1.85 + 7 / 9 * (18 * STOC125.1.90 + 7 / 9 * (19 * STOC125.1.95 + 7 / 9 * (20 * STOC125.1.100 + 7 / 9 * (21 * STOC125.1.105 + 7 / 9 * (22 * STOC125.1.110 + 7 / 9 * (23 * STOC125.1.115 + 7 / 9 * (24 * STOC125.1.120 + 7 / 9 * (25 * STOC125.1.125 + 7 / 9 * (26 * STOC125.1.130 + 7 / 9 * (27 * STOC125.1.135 + 7 / 9 * (28 * STOC125.1.140 + 7 / 9 * (29 * STOC125.1.145 + 7 / 9 * (30 * STOC125.1.150 + 7 / 9 * (31 * STOC125.1.155 + 7 / 9 * (32 * STOC125.1.160 + 7 / 9 * (33 * STOC125.1.165 + 7 / 9 * (34 * STOC125.1.170 + 7 / 9 * (35 * STOC125.1.175 + 7 / 9 * (36 * STOC125.1.180 + 7 / 9 * (37 * STOC125.1.185)))))))))))))))))))))))))))))))))))))

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stentoner
Posted : Monday, January 4, 2010 9:45:53 PM
Gold Customer Gold Customer

Joined: 3/23/2005
Posts: 4
Thanks, Bruce, for making the simple moving average case more understandable; I can fly solo for those. The exponential will take a little more thought. By the way, those references to cascaded moving averages in terms of filters are a bit esoteric. I might try the Excel approach.
Bruce_L
Posted : Tuesday, January 5, 2010 8:59:34 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
stentoner,
You're welcome. Our pleasure.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Ade42
Posted : Tuesday, January 12, 2010 4:35:51 PM
Registered User
Joined: 6/20/2008
Posts: 3
Hello,

I'm interested in getting a PCF that identifies stochastic crosses (%K thru %D) in oversold and overbought. I've tried various permutations of "< 20" and "> 80" into the formula below, but cannot seem to get anything that hits the nail on the head.

Set to simple, 14,3,3.

Any help would be most welcome.

Ade

QUOTE (Bruce_L)
twobben15,
Yes. This is somewhat ambiguous however as the 3 occurs as both the Stochastic Period and as the SD Period in the example (although I'm suspecting you would probably get the replacements right). The result would be:

Simple Stochastic 14,3,3 SK xUp SD:

STOC14.3 > AVG(STOC14.3,3) AND STOC14.3.1 <= AVG(STOC14.3.1,3)

Simple Stochastic 14,3,3 SK xDn SD:

STOC14.3 < AVG(STOC14.3,3) AND STOC14.3.1 >= AVG(STOC14.3.1,3)

Simple Stochastic 14,3,3 SK Crossing SD (either direction):

SGN(STOC14.3 - AVG(STOC14.3,3)) <> SGN(STOC14.3.1 - AVG(STOC14.3.1,3))
Bruce_L
Posted : Tuesday, January 12, 2010 4:49:09 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Ade42,
Welcome to the forums. A very good foundation for learning how to use TeleChart can be gained by reviewing the following:

If you are new to TeleChart READ THIS FIRST!

Please try one or more of the following Personal Criteria Formulas:

Simple Stochastic 14,3 SK xUp 20:

STOC14.3 > 20 AND STOC14.3.1 <= 20

Simple Stochastic 14,3 SK xDn 20:

STOC14.3 < 20 AND STOC14.3.1 >= 20

Simple Stochastic 14,3 SK crossing 20 (either direction):

SGN(STOC14.3 - 20) <> SGN(STOC14.3.1 - 20)

Simple Stochastic 14,3 SK xUp 80:

STOC14.3 > 80 AND STOC14.3.1 <= 80

Simple Stochastic 14,3 SK xDn 80:

STOC14.3 < 80 AND STOC14.3.1 >= 80

Simple Stochastic 14,3 SK crossing 80 (either direction):

SGN(STOC14.3 - 80) <> SGN(STOC14.3.1 - 80)

Simple Stochastic 14,3,3 SD xUp 20:

AVG(STOC14.3,3) > 20 AND AVG(STOC14.3.1,3) <= 20

Simple Stochastic 14,3,3 SD xDn 20:

AVG(STOC14.3,3) < 20 AND AVG(STOC14.3.1,3) >= 20

Simple Stochastic 14,3,3 SD crossing 20 (either direction):

SGN(AVG(STOC14.3,3) - 20) <> SGN(AVG(STOC14.3.1,3) - 20)

Simple Stochastic 14,3,3 SD xUp 80:

AVG(STOC14.3,3) > 80 AND AVG(STOC14.3.1,3) <= 80

Simple Stochastic 14,3,3 SD xDn 80:

AVG(STOC14.3,3) < 80 AND AVG(STOC14.3.1,3) >= 80

Simple Stochastic 14,3,3 SD crossing 80 (either direction):

SGN(AVG(STOC14.3,3) - 80) <> SGN(AVG(STOC14.3.1,3) - 80)

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Ade42
Posted : Thursday, January 14, 2010 7:18:17 AM
Registered User
Joined: 6/20/2008
Posts: 3
Hi Bruce,

Thanks for your reply. I already have formulae that work well at spotting SD crossing up through the 20% line or down through the 80% line. However, I find that that gets me into certain short-term trades a day or two late.

What I really need is a PCF that identifies SK crossing up thru SD, below the 20% line and SK XDn SD above the 80% line. Is such a thing possible?

Ade
Bruce_L
Posted : Thursday, January 14, 2010 9:10:37 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Ade42,
Simple Stochastic 14,3,3 SK xUp SD below 20:

STOC14.3 > AVG(STOC14.3,3) AND STOC14.3.1 <= AVG(STOC14.3.1,3) AND STOC14.3 < 20

Simple Stochastic 14,3,3 SK xDn SD above 80:

STOC14.3 < AVG(STOC14.3,3) AND STOC14.3.1 >= AVG(STOC14.3.1,3) AND STOC14.3 > 80

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