June 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:

TRADESTATION
TECHNIFILTER PLUS
WAVE WI$E MARKET SPREADSHEET
SMARTRADER
METASTOCK

or return to June Contents

TRADESTATION

The TradeStation programming tip for this month focuses on a rather simple idea, but it's one that's often requested by users. The code for the system and indicator presented here is based on the analysis techniques discussed in the interview with Jay Kaeppel in the May 1997 issue, namely, a filtered moving average crossover. The code given below is for the Power Editor, but both the indicator and the system can also be created in the Quick Editor.

Here, then, is the Power Editor code for implementing a filtered moving average crossover system in TradeStation. The system is called "Simple futures MA."





Type: System
Name: Simple Futures MA

Inputs: Price(Close), FastAvg(9), SlowAvg(50), AvgFltr(80);
Vars: FastMA(0), SlowMA(0), Filter(0);

FastMA = Average(Price, FastAvg);
SlowMA = Average(Price, SlowAvg);
Filter = Average(Price, AvgFltr);
Condition1 = Close > Filter;
Condition2 = Close < Filter;

IF FastMA Crosses Above SlowMA AND Condition1 Then
   Buy This Bar on Close;
IF FastMA Crosses Below SlowMA AND Condition1 Then
   ExitLong This Bar on Close;

IF FastMA Crosses Below SlowMA AND Condition2 Then
   Sell This Bar on Close;
IF FastMA Crosses Above SlowMA AND Condition2 Then
   ExitShort This Bar on Close;

Please note that for the above system, you must increase the MaxBarsBack in the Properties tab to cover the longest length referenced, which in this case is 80.

Below is the Power Editor code for the filtered moving average crossover indicator, also called "Simple futures MA," which is very similar to the code given above for the crossover system. For the indicator code, we've simply added the Plot statements and the Alert.





Type: Indicator
Name: Simple Futures MA

Inputs: Price(Close), FastAvg(9), SlowAvg(50), AvgFltr(80);
Vars: FastMA(0), SlowMA(0), Filter(0);

FastMA = Average(Price, FastAvg);
SlowMA = Average(Price, SlowAvg);
Filter = Average(Price, AvgFltr);
Condition1 = Close > Filter;
Condition2 = Close < Filter;

Plot1(FastMA, "FastMA");
Plot2(SlowMA, "SlowMA");
Plot3(Filter, "MAFilter");

IF (Plot1 Crosses Above Plot2 OR Plot1 Crosses Below Plot2) AND 
   (Condition1 OR Condition2) Then
        IF CheckAlert Then Alert = True;
Notice that you must specifically format the above indicator. The scaling for this indicator should be set to "Same as price data," and the MaxBarsBack can simply be set to "Auto-Detect."

This code is available at Omega's Web site. The file name is "SFAvg.ELA." The Quick Editor code is provided in a file called "SFAvgQ.ELA."

 

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

GO BACK

TECHNIFILTER PLUS

Jay Kaeppel describes a simple trading system in his May 1997 interview. The idea is to trade on the crossover of two averages, provided the close is above or below a third, longer average. The following TechniFilter Plus strategy implements his system. The formulas list the three averages; the signals list the conditions for entering and exiting positions; and the rules implement the system.




Strategy Name: KAEPPEL
FORMULAS
1. name: AVG(9)             format: ####.##
   formula: CA&1
2. name: AVG(50)            format: ####.##
   formula: CA&1
3. name: AVG(80)            format: ####.##
   formula: CA&1
SIGNALS
1. OPEN LONG; F1>F2 AND C>F3
2. CLOSE LONG; F1<F2 AND C>F3
3. OPEN SHORT; F1<F2 AND C<F3
4. CLOSE SHORT; F1>F2 AND C<F3
RULES
1. Buy Long 1 at Today's Close on signal: S1
2. Sell Long 1 at Today's Close on signal: S2
3. Open Short 1 at Today's Close on signal: S3
4. Cover Short 1 at Today's Close on signal: S4

This TechniFilter Plus strategy and the reports, strategies and formulas of earlier Traders' Tips can be downloaded from RTR's Web site.

-- Clay Burch, RTR Software
919 510-0608, E-mail: rtrsoft@aol.com
Internet: https://www.rtrsoftware.com

GO BACK


WAVE WI$E MARKET SPREADSHEET

Here is a WAVE WI$E program implementation of the simple moving average crossover strategy given by Jay Kaeppel in his interview.




A:   DATE    @TC2000(c:\tc2000\data,IBM,IBM,DB)
B:   HIGH
C:   LOW 
D:   CLOSE
E:   OPEN
F:   VOL
G:   avg9    @MAVG(CLOSE,9)
H:   avg50   @MAVG(CLOSE,50)
I:   avg80   @MAVG(CLOSE,80)
J:   Longs   @SIGNAL(CLOSE,BUY,AVG9>AVG50 & CLOSE>AVG80,
              AVG9<AVG50 & CLOSE>AVG80)
K: 
L:   Shorts  @SIGNAL(CLOSE,BUY,AVG9<AVG50 & CLOSE<AVG80,
              AVG9>AVG50 & CLOSE<AVG80)
-- Peter Di Girolamo, Jerome Technology
908 369-7503, E-mail: jtiware@aol.com
Internet: https://members.aol.com/jtiware
GO BACK


SMARTRADER

Jay Kaeppel's simple trading system described in the May issue is based on the crossover of two simple moving averages (SMAS), filtered by the crossover of the closing price and a longer SMA. This system is easily implemented in SMARTrader.
FIGURE 1: SMARTRADER. This SMARTrader SpecSheet implements Jay Kaeppel's moving average crossover system.

Rows 9, 10 and 11 in the SMARTrader SpecSheet code in Figure 1 contain the nine-, 50- and 80-period moving averages as specified in the interview. They have been renamed here to reflect the number of periods in each.

Rows 12 through 15 are the entry and exit rules for the long and short positions. Note that the actual crossover point is where the ampersand ("&") occurs in each statement, which separates the previous period in the opposite or reverse condition. This prevents the continuous generation of buy and sell conditions after the first time the crossover occurs.

Rows 16 through 20 are the accounting rows for the actual trades and the results they produce.

This system can also be implemented using CompuTrac SNAP by eliminating the minus (-) sign from within the square brackets. This SpecSheet file is available from Stratagem Software's Web site.

-- Jim Ritter, Stratagem Software International
504 885-7353, E-mail: Stratagem1@aol.com
Internet: https://www.stratagem1.com
GO BACK


METASTOCK

It's quite easy to use MetaStock for Windows to duplicate the simple moving average crossover trading system (Figure 2) presented in the interview last issue with Jay Kaeppel. In MetaStock, choose System Tester from the Tools menu. Click on the New button and enter the following rules:




SIGNAL FORMULAS
Enter Long:
     Cross( Mov( CLOSE,9,S), Mov( CLOSE,50,S)) AND
     CLOSE > Mov( CLOSE,80,S)

Close Long:
     Cross( Mov( CLOSE,50,S), Mov( CLOSE,9,S)) AND
     CLOSE > Mov( CLOSE,80,S)
 
Enter Short:
     Cross( Mov( CLOSE,50,S), Mov( CLOSE,9,S)) AND
     CLOSE < Mov( CLOSE,80,S)

Close Short:
     Cross( Mov( CLOSE,9,S), Mov( CLOSE,50,S)) AND
     CLOSE < Mov( CLOSE,80,S)
FIGURE 2: METASTOCK. Here's sample output from a MetaStock implementation of Jay Kaeppel's moving average crossover system.

When testing futures in MetaStock, it's best to use a "Points only" test. To do this, choose "Options" from the System Tester dialog and then choose "Points only test" from the Testing page.

To use The Explorer to screen for futures generating a recent signal with this system, choose The Explorer from the Tools dialog and enter the following rules:





COLUMN FORMULAS
ColumnA: Buy Sign
   Cross( Mov( CLOSE,9,S), Mov( CLOSE,50,S)) AND
   CLOSE > Mov( CLOSE,80,S)

ColumnB: Shrt Sig
   Cross( Mov( CLOSE,50,S), Mov( CLOSE,9,S)) AND
   CLOSE < Mov( CLOSE,80,S)
 
FILTER SOURCE
Filter Enabled: Yes

   Formula:
     colA = 1 OR colB = 1
Next, choose "Explore," and The Explorer will search for and then display any futures that have generated new signals.

-- Allan McNichol, Equis International
800 882-3040, 801 265-8886
Internet: https://www.equis.com

GO BACK


Return to June Contents