All you want to know about Stochastics

August 2005 Ensign Wed Class Transcript

June 2006 Ensign Newsletter 78 Stochastic Formula

August 2001 Ensign Newsletter 20 Stochastic Fundamental Behavior

October 2001 Ensign Newsletter 22 Stochastic Parameters

Stochastic Values

17:46 mikey: In previous charting packages I have used, stochastics required only two values:%K and %D. In Ensign, I am puzzled by the Bars parameter. So, my question is what would one enter for, say, a stochastics of 14/3?

17:48 Ensign Howard: Mikey, the Stochastic has a bars parameter which is the period over which the Highest High and Lowest Low is found. A typical parameter is 14. Then the Stochastic has a smoothing parameter for the average of the raw stochastic values which are too choppy to be of much use. So the average parameter is needed, and typically this is a 3 or a 5. The first average of the raw stochastic is the %K Slow line.

17:50 Ensign Howard: Most want to also plot a 2nd line which is another moving average of the %K Slow data, and this 2nd average is called the %D Slow line.

17:51 Ensign Howard: Since a 2nd average is involved, a 2nd average parameter is needed, and if this is NOT provided independently of the 1st average parameter, then the other charting software probably just uses the 1st average parameter for the 2nd average as well. So the 14/3 would be a 14 period for HH and LL range, and 3 for smooth for %K line and an assumed 3 for the %D line.

17:52 Ensign Howard: Most software has both %K and %D lines as first average of raw stochastic and 2nd average of the 1st average. In Ensign we allow you to use a different parameter for the %K average and the %D average, So something like 14/5/3 would be 14 bars, 5 for 1st average parameter, and 3 for 2nd average parameter.

17:52 mikey: If I understand, then, other charting packages provide for only one level of smoothing? that is, %D

17:53 Ensign Howard: no Mikey, they all do 2 average. It is just that the use the same average parameter for both averages. Let me show a formula example.

17:54 Ensign Howard: raw = (HH - Last) / (HH - LL)

17:54 Ensign Howard: %K = MovAve( Raw, 3 )

17:54 Ensign Howard: %D = MovAve( %K, 3 )

17:55 Ensign Howard: In Ensign we allow you to use different values in the position of the 3 parameter shown in the example. We all do the 2 averages. I think I have my Raw inverted and I showed the William's Percent R formula

17:56 Ensign Howard: raw = (Last - LL) / (HH-LL)

17:57 Ensign Howard: That way when Last is = to HH then the raw is a 1.00. Raw is also shown as a percent by having * 100 on the formula. So Last at new highs is a raw stochastic of 100 and Last at new lows is a raw stochastic of 0

17:58 Ensign Howard: HH is Highest high in the set of bars in the period of 14 bars and LL is the Lowest Low in the set of bars in the period

17:58 mikey: So in another package that takes only two values, the value for %K will use the smoothing factor specified by %D, and %D will apply its own value to %K?

17:59 Ensign Howard: Mikey, if they have 1 average parameter it must be used in two places so it just is a little less flexibility. If they have 14/3 then the equivalent in Ensign would be to use 3 for both averages by entering in 14/3/3

17:58 Ensign Howard: On the topic of stochastic is our excellent Trading Tips articles from a few years ago. See Links above - #78 and #20.

18:02 Ensign Howard: I think these 2 articles from the Newsletters is a better treatment of what Stochastic is and does than anything else I have ever read. So the article shows the effect of different formulas and different parameters using side by side images. This is a class A article, one of our best, and often referenced and still not out of date. If my articles were to be published in a book, this is one that would be included in the final cut for inclusion

Stochastics Property Window
 
I have a question about Ensign Stochastics. Let me tell you what I'm trying to accomplish and maybe you can give me a work around. I'm trying to match a Tradestation  5 min chart that has a simple 8-3-3 Slow Stochastic using %K and %D. It also has a simple 8-3-3 Fast Stochastic using %K only. This puts three stochastic lines in one sub window on the chart. My dilemma is that I'm not getting the same peaks and valleys on the %K line of the Slow Stochastic. I use the IB feed and I realize that there will always be differences between different data feeds but seeing that these are minute charts I would hope that I could get them fairly close. However, at times there are major differences in the peaks and valleys of the stochastic lines between the TS chart and my Ensign chart. I'm asking this because Ensign doesn't distinguish between Slow and Fast Stochastics(that I'm aware of) and I thought you might be able to shed a little light for me here. A lot of charting programs have both and I'm sure you have a reason for not having both. I just need some guidance here. Thanks.
 

Hi,
 
Slow stochastic is a moving average of Fast Stochastic.
So if you want Fast Stochastic have the %K parameter set to a 1.   Now %K will be Fast Stochastic and the %D will be the 1st average of Fast Stochastic.
This will give you 2 lines for Fast Stochastic %K and %D.
 
If you want the 3rd line, put on Stochastic again and this time have a parameter of 3 for the %K parameter.   Now the Slow %K will be identical to the Fast %D.
Both are the 1st average of the raw stochastic.   You only need to plot Slow %D which is the 2nd average.
 
So in summary the 3 lines are.
 
1st Line is Raw Stochastic, or Fast %K, and the parameters are   Bar = 8, %K = 1, %D = 3
2nd Line is 1st Average, or Fast %D, or Slow %K, and the parameters are same as above, and plot Fast %D.
3rd Line is 2nd Average, or Slow %D, and the parameters are  Bar = 8, %K = 3, %D = 3
 
Sincerely, Howard Arrington

 


Study Tip:

Stochastic Formula
by Howard Arrington

Raw stochastic is the percentage of where a price is in a range of highest high - lowest low over a set of bars.   Some call the raw value Fast %K.

          Raw Stochastic = 100 * (Last - LowestLow) / (HighestHigh - LowestLow).

Slow %K is an average of the Raw Stochastic.  Some call this first average Fast %D.

Slow %D is an average of the Slow %K.   This is the 2nd average.

Ensign Windows has 4 choices of which formula to use for calculating the averages.  The average used for the original Stochastic work was an exponential moving average.  However, variations using simple average, weighted average and smoothed average are also worthy and useful Stochastic calculations.

The smoothed average formula is very similar to the exponential formula.  The difference is in how the Alpha decay factor is derived from the average parameter  N.   See these formulas:

          Exponential = Previous Average  +  ((Current Value - Previous Average) / Alpha)  
                    where Alpha = (N+1)/2 

          Smoothed = Previous Average  +  ((Current Value - Previous Average) / Alpha)
                    where Alpha = N

The parameter N is greater than or equal to 1.  If  the parameter entered is less than 1, then invert the parameter using  N = 1 / parameter.

Ensign Windows does not do a 3rd average.   If an average of the Slow %D is wanted, then put on a moving average study and set its Data Point to be the %D value of the Stochastic study.

Click the following links for two excellent articles in past Trading Tips issues for additional information about the Stochastic study.

Last updated 07/01/2007