January 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
WAVEWI$E MARKET SPREADSHEET
TECHNIFILTER PLUS
SMARTRADER

or return to January Contents

TRADESTATION

To recreate the ADRrs-NH-NL system as described by Dennis Meyers in "A daily A-D new high-new low market system," as well as the indicators that plot the ADRrs, Nhstr and NL Nlstr lines, several steps must be taken to set up the proper environment in TradeStation. The system and indicators described in the article must be plotted on a multidata chart. The data for each series in the multidata chart would be defined as follows:





Data1 = S&P500
Data2 = DJIA
Data3 = Daily NYSE 52-week New Highs
Data4 = Daily NYSE 52-week New Lows
Data5 = Daily NYSE Advancing Issues
Data6 = Daily NYSE Declining Issues
Of the six data series that must be included in your multidata chart, Data2 through Data6 can be plotted in a hidden subgraph. Only Data1 (Standard & Poor's 500) really needs to be displayed. Once you have created the multidata chart, you are then ready to begin creating the system and indicators.

The first step in the building process would be to create the StrCalc function. This function performs the calculation of the strength variables within the system and indicators.





Type: User Function
Name: StrenCalc

Inputs: Price(Numeric), Length(Numeric);
Vars: LoLo(0), HiHi(0), Rng(0);

LoLo = Lowest(Price, Length);
HiHi = Highest(Price, Length);
Rng = HiHi - LoLo;

StrenCalc = 100 * ((Price - LoLo) / Rng) - 50;
Once you have created and verified the StrCalc function, you are then ready to create the ADRrs-NH-NL system in the Power Editor using this code:




Type: System
Name: ADRrs-NH-NL

Inputs: Brs(4), Srs(-40), XDays(10), NLbx(-10), NLsx(30), LDays(40),
        NHbx(-10), NHsx(0), HDays(10);
Inputs: DJC(C Data2), NH(C Data3), NL(C Data4), AI(C Data5), DI(C Data6);
Vars: ADR(0), NHx(0), NLx(0), ADRx(0), ADRs(0);

NHx = XAverage(NH, 3);
NLx = XAverage(NL, 3);
ADRx = XAverage((AI-DI)/(AI+DI), 10);
ADRs = StrenCalc(ADRx, XDays) - StrenCalc(DJC, XDays);

IF ADRs >= Brs AND StrenCalc(NLx, LDays) <= NLbx AND 
  StrenCalc(NHx, HDays) >= NHbx Then 
  Buy This Bar on Close;

IF ADRs <= Srs AND StrenCalc(NLx, LDays) >= NLsx AND
  StrenCalc(NHx, HDays) <= NHsx Then
  Sell This Bar on Close;
Now you can also create the three indicators that plot the ADRrs, Nhstr and Nlstr lines. The Power Editor code for the ADRrs indicator would be written in the Power Editor as follows:




Type: Indicator
Name: ADRrs

Inputs: Brs(5), Srs(-35), XDays(10);
Inputs: DJC(C Data2), AI(C Data5), DI(C Data6);
Vars: ADRx(0), ADRs(0);

ADRx = XAverage(AI/DI, 10);
ADRs = StrenCalc(ADRx, XDays) - StrenCalc(DJC, XDays);

Plot1(ADRs, "ADRs");
Plot2(Brs, "Brs");
Plot3(Srs, "Srs");

The Power Editor code for the Nhstr indicator would be written in the Power Editor as follows:





Type: Indicator
Name: ADRrs - NHstr

Inputs: NHbx(-10), NHsx(0), HDays(10);
Inputs: NH(C Data3);
Vars: NHx(0);

NHx = XAverage(NH, 3);

Plot1(StrenCalc(NHx, HDays), "NHx");
Plot2(NHbx, "NHbx");
Plot3(NHsx, "NHsx");

The Power Editor code for the Nlstr indicator would be written in the Power Editor as follows:





Type: Indicator
Name: ADRrs - NLstr

Inputs: NLbx(-10), NLsx(30), LDays(40);
Inputs: NL( C Data4 );
Vars: NLx(0);

NLx = XAverage(NL, 3);

Plot1(StrenCalc(NLx, LDays), "NLx");
Plot2(NLbx, "NLbx");
Plot3(NLsx, "NLsx");

The inputs used in the indicators above should reflect the same values that are used in the inputs for the ADRrs-NH-NL system. Each indicator, though, only references those input values that are directly relevant to the indicator itself. The scaling for the three indicators above would be set to Screen.

This code is available at Omega's Web site. The file name is "ADRrsNHL."

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

WAVEWI$E MARKET SPREADSHEET

Here are the WAVEWI$E spreadsheet formulas for implementing the daily A-D new high-new low market (ADRrs-NH-NL) system, which is a system that uses daily statistics to issue buy and sell signals for the stock market.




A: DATE     @TC2000(c:\tc2000\data,DJ-30,DOW JONES INDUSTRIALS,D)
B: DJC 
C: DATE     @TC2000(c:\tc2000\data,SP-500,STANDARD & POORS 500,D)
D: SP500
E: AVI      'Advances data
F: DCI      'Declines data
G: NEWHI    'New highs data
H: NEWLO    'New lows data
I: ADR      (AVI-DCI)/(AVI+DCI)
J: NLX      @EAVG1(NEWLO,3)
K: NHX      @EAVG1(NEWHI,3)
L: ADRX     @EAVG1(ADR,10)
M: NLSTR    100*(NLX-@MIN(NLX,10))/((@MAX(NLX,10)-@MIN(NLX,10)))-50
N: NHSTR    100*(NHX-@MIN(NHX,10))/((@MAX(NHX,10)-@MIN(NHX,10)))-50
O: ADRSTR   100*(ADRX-@MIN(ADRX,10))/((@MAX(ADRX,10)-@MIN(ADRX,10)))-50
P: DJCSTR   100*(DJC-@MIN(DJC,10))/((@MAX(DJC,10)-@MIN(DJC,10)))-50
Q: ADRRS    ADRSTR-DJCSTR
R:          PROCEDURE(BUYSELL)

PROCEDURE BUYSELL 
#NAME BRS   1       'SET BUY / SELL VARIABLES 
#NAME NLB   1
#NAME NHBX  1
#NAME SRS   1
#NAME NLSX  1
#NAME NHSX  1

@SIGNAL(SP500,BUY,(ADRRS>BRS) & (NLSTR<=NLB) & (NHSTR>=NHBX),
     (ADRRS<=SRS) & (NLSTR>=NLSX) & (NHSTR<=NHSX))
 

-- Peter Di Girolamo, Jerome Technology
908 369-7503, E-mail: jtiware@aol.com

GO BACK

TECHNIFILTER PLUS

Here's a TechniFilter Plus trading strategy that implements Dennis Meyers's daily A-D new high-new low market system. The strategy assumes that you have the six time series in your database (NYSE advancing issues, NYSE declining issues and so forth) with the same ticker symbols that Meyers used in his article.

Formula 1 gives the closing value of the DJIA. Formulas 2 and 3 are the three-day exponential averages of the new lows and new highs. Formula 4 is the 10-day exponential average of the advance-decline ratio. Formulas 5, 6, 7 and 8 are, respectively, the new low strength, the new high strength, the DJIA strength, and the advance-decline strength. The final formula is the difference between the advance-decline strength and the DJIA strength. The signals give the requirements for reversing positions. The parameters listed are the optimized values suggested by Meyers.





Strategy Name: D_NH_NL
FORMULAS
1. name: DJIA                     format: ####.##
   formula: ~<DJC>~
2. name: NLX(3)                   format: ####.##
   formula: ~<NL>~X&1
3. name: NHX(3)                   format: ####.##
   formula: ~<NH>~X&1
4. name: ADRX(10)                 format: ####.##
   formula: ( (~<AI>~-~<DI>~) / (~<AI>~+~<DI>~) )X&1
5. name: NL_STR(40)               format: ####.##
   formula: 100 * ([2]-TN&1) / ([2]M&1-[2]N&1) - 50
6. name: NH_STR(10)               format: ####.##
   formula: 100 * ([3]-TN&1) / ([3]M&1-[3]N&1) - 50
7. name: ADR_STR(10)              format: ####.##
   formula: 100 * ([4]-TN&1) / ([4]M&1-[4]N&1) - 50
8. name: DJC_STR(10)              format: ####.##
   formula: 100 * ([1]-TN&1) / ([1]M&1-[1]N&1) - 50
9. name: ADR_RS                   format: ####.##
   formula: [7]-[8]
SIGNALS
1. BUY;F9>=4 & F5<=-10 & F6>=-10
2. SELL;F9<=-40 & F5>=30 & F6<=0
RULES
1. Reverse Short to Long 1 at Today's Close on signal: S1
2. Reverse Long to Short 1 at Today's Close on signal: S2

This TechniFilter Plus strategy and those of previous months 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


SMARTRADER

Dennis Meyers's daily A-D new high-new low market system is easily constructed using SMARTrader's preprogrammed exponential moving average (EMA) and fast stochastic studies to calculate the strength variables. All the inputs are defined as coefficients to permit optimization if the user desires (Figure 1). User rows are used for the various other calculations and the trading rules.

The first 40 rows, which give instructions for loading the data, are omitted here for brevity. The data vendor provides advance/decline data in O,H,L,C,V,OI format. New Lows is CLOSE2. New Highs is CLOSE3. The DJIA is CLOSE4.

Row 41 is the calculation of the advance/decline ratio. Rows 42, 43 and 44 are the Ema of new lows, new highs and the A/D ratio, respectively. Rows 45-53 are coefficient rows containing the various periods and test levels needed by the system.

Row 54 uses the preprogrammed fast stochastic, or K, to compute the raw K or strength value of nlx in a range of zero to 100. Row 55 subtracts 50 to establish a normalized range of +50 to -50. The process is repeated for nhx, adrx and DJIA (CLOSE4). Note that K usually uses high, low and close, but here, we repeat the same variable in each parameter position.

The last two rows are the buy and sell rules. Note that each element of the compound conditions is enclosed in parentheses.

Figure 1: SMARTRADER. In the daily A-D new high-new low market system, the last two rows are the buy and sell rules.
-- Jim Ritter, Stratagem Software International
504 885-7353, E-mail: Stratagem1@aol.com
GO BACK

Return to January Contents