September 1999
TRADERS' TIPS

Here is this month's selection of Traders' Tips, contributed by various developers of technical analysis software to help readers more easily implement some of the strategies presented in this issue.

You can copy these formulas and programs for easy use in your spreadsheet or analysis software. Simply "select" the desired text by highlighting as you would in any word processing program, then use your standard key command for copy or choose "copy" from the browser menu. The copied text can then be "pasted" into any open spreadsheet or other software by selecting an insertion point and executing a paste command. By toggling back and forth between an application window and the open Web page, data can be transferred with ease.
 

This month's tips include formulas and programs for:
TRADERSTATION / SUPERCHARTS
NEUROSHELL TRADER
METASTOCK
TECHNIFILTER PLUS
SMARTTRADER
WAVEWI$E MARKET SPREADSHEET

or return to September 1999 Contents


TRADESTATION/SUPERCHARTS

This month in Traders' Tips we take a look at stochastics as defined in this issue's article "Stochastics" by Stuart Evens. The calculation of the %K line, as defined in the article, is identical to the way in which it is calculated in EasyLanguage. The %D line, though, differs slightly. With this in mind, I have presented the calculation for the %K and %D, using both the regular and slow calculations. In addition, I have included two EasyLanguage indicators, one that plots the regular version of the pair and one that plots the slow version of the pair.

We begin by creating functions for each of the %K and %D calculations. Obviously, the calculations are not very complex, but I still chose to create them as user functions. The reason for creating them as functions is that it provides the versatility of using these calculations in any of my own custom studies without having to recreate the calculations each time. The EasyLanguage for each of the four functions is as follows:
 

Name: StochKreg
Type: Function
Input: Length(Numeric);
Variables: HH(0), LL(0);
HH = Highest(High, Length);
LL = Lowest(Low, Length);
StochKreg = 100 * ((Close - LL) / (HH - LL));
Name: StochDreg
Type: Function
Inputs: Length(Numeric), SlowPeriod(Numeric);
Variables: HH(0), LL(0);
HH = Highest(High, Length);
LL = Lowest(Low, Length);
StochDreg = 100 * (Summation(Close - LL, SlowPeriod) / Summation(HH - LL, SlowPeriod));
Name: StochKslow
Type: Function
Inputs: Length(Numeric), SlowPeriod(Numeric);
StochKSlow = StochDreg(Length, SlowPeriod);
Name: StochDslow
Type: Function
Input: Length(Numeric), SlowPeriod(Numeric);
StochDSlow = Average(StochDreg(Length, SlowPeriod), SlowPeriod);


The indicators for creating the regular stochastic lines and the slow stochastic lines would be written in the PowerEditor using the EasyLanguage as follows:
 

Name: Stoch - Reg
Type: Indicator
Inputs: Length(5), SlowLen(3);
Plot1(StochKreg(Length), "%K-reg");
Plot2(StochDreg(Length, SlowLen), "%D-reg");
Name: Stoch - Slow
Type: Indicator
Inputs: Length(5), SlowLen(3);
Plot1(StochKSlow(Length, SlowLen), "%K-Slow");
Plot2(StochDSlow(Length, SlowLen), "%D-Slow");


The indicators above appear best when they are scaled to "User Defined -- Maximum = 100 and Minimum = 0."

This EasyLanguage code is also available from Omega Research's Website. The name of the file is STOCH.ELS. Note that all Traders' Tips posted at the Omega Research Website can be utilized by both TradeStation and SuperCharts. When possible, the posted analysis techniques will include both QuickEditor and PowerEditor formats.
 

-- Gaston Sanchez, Omega Research Inc

 

 
 
 

800 422-8587, 305 270-1095
Internet: https://www.omegaresearch.com

GO BACK

NEUROSHELL TRADER

The K, %D, and %D slow stochastic indicators are included in the 800-plus technical indicators built into NeuroShell Trader and are easily inserted into a chart using NeuroShell Trader's Indicator Wizard.
 
 


FIGURE 1: NEUROSHELL TRADER. On Indicator Wizard screen 1, select the Price Momentum category.

FIGURE 2: NEUROSHELL TRADER. On Indicator Wizard screen 2, select the %K stochastic indicator.

FIGURE 3: NEUROSHELL TRADER. Screen 3 of the Indicator Wizard shows the default parameters for the stochastic %K indicator.


To insert a stochastic indicator, go to the Insert menu and select the "New indicator" menu item. This brings up the Indicator Wizard.

The first wizard screen (Figure 1) displays a list of indicator categories. Select either the "Price momentum indicators" or the "(All indicators)" category and then press the Next button.

The second wizard screen (Figure 2) displays a list of all the indicators in the previously selected indicator category. Select the stochastic %K, stochastic %D, or the stochastic slow %D and press the Next button.

The last screen of the wizard (Figure 3) displays the default indicator parameters and allows a user to enter custom parameter values. To match the original stochastic formulas, use the default parameter values for everything except the stochastic slow %D smoothing period 2, which should be set to 3.

The %D and slow %D indicators implemented in NeuroShell Trader use an exponential smoothing. However, a user can easily implement a simple, linearly weighted, volume-weighted, or adaptive smoothing by using the Indicator Wizard to apply the appropriate moving average to a stochastic %K.

 
-- Marge Sherald, Ward Systems Group, Inc.

 

 
 
 

301 662-7950
E-mail: wardsystems@msn.com
Internet: https://www.neuroshell.com

GO BACK

METASTOCK

Here is the MetaStock 6.5 or higher custom formula for stochastics:
 
KPERIODS KPERIODS := Input(%K Time Periods,1,20,5); KSLOW := Input(%K Slowing,1,20,3);
DPERIODS := Input(%D Time Periods,1,20,3); K :=
100*(Sum(CLOSE - LLV(LOW,KPERIODS),KSLOW)) /
(Sum(HHV(HIGH,KPERIODS)-LLV(LOW,KPERIODS),KSLOW));
D := Mov(K,DPERIODS,S);
K;
D;


MetaStock also contains built-in indicators for the stochastic oscillator and stochastic momentum index.

-- Cheryl Elton, Equis International

 

 
 
 

Internet: https://www.equis.com

GO BACK

TECHNIFILTER PLUS

TechniFilter Plus' library contains several stochastic formulas. The ST_FK(5) is the name of the TechniFilter Plus formula that corresponds to the %K (normal, not fast) formula discussed in the article "Stochastics" elsewhere in this issue. TechniFilter Plus' manual describes this formula as the stochastic fast %K.

The fast %D discussed in the article is named ST_FD(5,3) in the TechniFilter Plus library and is described in the manual as stochastic fast %D. The slow %D discussed in the article is given by the library formula SLOWD(5,3,3).

Other stochastic formulas available in the TechniFilter Plus library include formulas to pick out the crosses of the slow and fast stochastic, overbought/oversold oscillators, stochastic oscillators, and stochastic position formulas. There is also a stochastic filter report and a stochastic trading strategy in the library.

These formulas can be downloaded from RTR's Website. Release 8.2 of TechniFilter Plus is now available.

-- Clay Burch, RTR Software

 

 
 
 

919 510-0608
E-mail: rtrsoft@aol.com
Internet: https://www.rtrsoftware.com

GO BACK

SMARTTRADER

At Stratagem Software, we are often asked how various studies work. Here, I will present the setup of George Lane's stochastic and slow stochastic and then explain how they work by building them piece by piece in SmarTrader.


FIGURE 4: SMARTTRADER. This SmarTrader specsheet demonstrates the stochastic indicators.


In recent years some hybrid calculations have been developed, so we will first describe how to create the original formula. Then we'll describe a "shortcut" version.

The preprogrammed stochastic in SmarTrader consists of a %K line and a %D line. In the SmarTrader specsheet in Figure 4, rows 9 and 10 are the standard %K and %D calculations. Note that they both use the high, low, and close price fields so that they may be calculated independently of each other. The number of periods is five. Slow_D% is a simple moving average based on the regular D% over three periods.

Row 12, Hh5, uses the preprogrammed function Highest to determine the highest high over the last five periods. Row 13, Ll5, uses the Lowest function to determine the lowest low in a like manner. Row 14, W1, is a user row that calculates the current close minus the Ll5. Row 15, W2, is a user row to calculate the five-period Highest minus Lowest. Row 16, myK, normalizes the division of W1 by W2 to a scale of zero to 100. Rows 17 and 18 sum W1 and W2 over three periods and then the results are normalized in row 19 as myD%. Row 20, mySlowD%, is the easy part. It's a simple moving average of the regular myD% over three periods.

The "shortcut" version used in some programs calculates the standard %K, then takes a three-period moving average of %K to create %D. Slow_D%, then, is a three-period moving average of a three-period moving average.

Although some studies are quite complex, most are fairly simple. They have been "canned" or preprogrammed in software to insulate the technician from having to remember how they work and from the tedium of construction.

-- Jim Ritter, Stratagem Software International

 

 
 
 

504 885-7353
E-mail: Stratagem1@aol.com
Internet: https://www.stratagem1.com

GO BACK

WAVEWI$E MARKET SPREADSHEET

The following WaveWi$e formulas show how to compute, in detail, the stochastics function. WaveWi$e has built-in functions for both stochastics and %D.
A:      DATE    @TC2000(C:\TC2000\DATA,SP-500,STANDARD & POORS 500,DB)
B:      HIGH 
C:      LOW 
D:      CLOSE 
E:      OPEN 
F:      VOL 
G:      period  5 
H:      'THE FOLLOWING 2 FORMULAS USE WAVE WI$E BUILT-IN FUNCTIONS
I:      Kfunc   @STOCH(HIGH,LOW,CLOSE,PERIOD)
J:      %Dfunc  @STOCH%D(HIGH, LOW, CLOSE, PERIOD, 3)
K:      'THE FOLLOWING COMPUTES STOCHASTICS IN ONE FORMULA 
L:      Kmath   100*(CLOSE-@MIN(LOW,PERIOD)) / 
         (@MAX(HIGH,PERIOD) - @MIN(LOW,PERIOD))
M:      'THE FOLLOWING SHOW THE FORMULAS PER THE TEXT
N:      LL5     @MIN(LOW,PERIOD)
O:      HH5     @MAX(HIGH,PERIOD)
P:      CC_LL5  CLOSE-LL5
Q:      H3      @ADD(CC_LL5,3)
R:      HH5_LL5 HH5-LL5
S:      L3      @ADD(HH5_LL5,3)
T:      Kreg    100 * CC_LL5 / HH5_LL5
U:      %D      100 * H3 / L3
V:      %Dslow  @MAVG(%D,3)
==========End Formulas
 
-- Peter Di Girolamo, Jerome Technology

 

 
 
 

908-369-7503
E-mail: jtiware@aol.com
Internet: https://members.aol.com/jtiware

GO BACK

All rights reserved. © Copyright 1999, Technical Analysis, Inc.

Return to September 1999 Contents