[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Gann Swing chart code for Metastock



PureBytes Links

Trading Reference Links

Frank & Waheeb,

I am not quite sure that I followed you Frank,since you used slowing which 
could have some double meanings here. Nor am I sure about your question Waheeb 
since it doesn't make since.

So to throw my two cents into this, the stoch has two parts. A %K and a %D. The 
%K is the stochastics and the %D is nothing more than the moving average of %K.
SO I repeat the %D is a moving average of %K. 

Now we have two opions with the %K. One is the time period (# of days, weeks, 
etc) we are interested in. The other is the slowing period.

I will make a couple of comments and suggest the best thing todo is to look in 
the Metastock manual for stoch as a custom indicator. they give a stoch(5,3) as 
an example. Write the formula out to see what is happening with the formula.

IMPORTANT: When the stoch has a slowing period equal to 1. Then the stoch and 
the Williams %R for the same time periods are identical indicators.

Last comments. IF you sit down and work out the formula for stoch(5,3) what I 
am going to put down will make since. Other wise it may not.
Below is the custom formula copied from MS.

Stochastic Oscillator

The following formula calculates a 5-period %K Stochastic Oscillator with 
3-period slowing:
(sum( C - llv(L,5), 3 ) / sum(hhv(H,5) - llv(L,5), 3) ) * 100
This next formula calculates a 3-period %D of the %K in the preceding formula.
mov( stoch(5,3), 3, E )

If you break the below formula down -


(sum( C - llv(L,5), 3 ) / sum(hhv(H,5) - llv(L,5), 3) ) * 100


 it becomes something like this (NOTE- the lower case t is time period. SO 
today is t and yesterday is t-1.)  :

     [Ct - LLVt(L,5)] + [Ct-1 - LLVt-1(L,5)] + [Ct-2 - LLVt-2(L,5)]
-------------------------------------------------------------------------*100
[HHVt(H,5)-LLVt(L,5)]+[HHVt-1(H,5)-LLVt-1(L,5)]+[HHVt-2(H,5)-LLVt-2(L,5)]

So what we have in the numerator (top part) is the numerator for the todays 
(t) stoch(5,1) added to the numerator of yesterdays (t-1) stoch(5,1) and added 
to the day before yesterdays (t-2) stoch(5,1).

The numerator has the corresponding numerators for the stoch(5,1) days from 
above.

SO if we look at this algebracially we can put it in the form:

(a + b + c)
-----------
(d + e + g)

where a, b & c can be looked at as numerators of different slopes and d, e & g 
can be treated as the denominators of the same slopes. SO a/d, b/e & c/g would 
be the slopes.

So what does the slowing days do in terms of a pure mathematical 
interpretation? Well I don't know. But I should. This is as far as I have come 
interms of working on this problem. I need to go to the math library at the U 
of M to get the answer.

I am pretty sure that you can break (a + b + c) into seperate parts.
                                    -----------
                                    (d + e + g)

I am pretty sure I know what book to look in. It is a numerical analysis book.

Once it is broken apart I can get an interpretation for you.

I know I have added much more than what was asked but I hope that you can get a 
better understanding of the formula. Buy doing so you can look at the daily bar 
charts to get an idea of what your stock would look like with out even plotting 
it.


Harley Meyer
meyer093@xxxxxxxxxx