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

or return to November Contents

TRADESTATION

The focus of this month's Traders' Tips is the article "Using Fibonacci ratios and momentum" by STOCKS & COMMODITIES Editor Thom Hartle. In this TradeStation implementation, we'll focus on the RSI-based oscillator described in the article.

In TradeStation, Fibonacci bands can be applied using the support/resistance drawing tool. In addition, a standard RSI indicator is built into the program. For Traders' Tips this month, I have developed an oscillator-type directional indicator that's based on the RSI calculation and its relation to 50. In addition, I have developed two PaintBar Studies, which are also based on the RSI and its relation to 50.

This version of the RSI oscillator indicator basically transforms the typical RSI into a zero-based oscillator. Values above the equal line represent RSI values above 50. Values below the equal line represent RSI values below 50. If the histogram input is set to y, the zero-based RSI values will be displayed in a histogram format. If the line input is set to y, the zero-based RSI values will be displayed in line format. In addition, if the alert feature is enabled, an alert will be triggered if the RSI-based value crosses above or below zero.

This indicator can be written in the TradeStation Power Editor as follows. The suggested format settings for this indicator are outlined after the code.

Type: Indicator
Name: RSI Oscillator
Inputs: Price(Close), RSILen(14), Histgram("Y"), Line("Y");
Vars: RSIVal(0);

RSIVal = RSI(Price, RSILen);

IF UpperStr(Histgram) = "Y" OR UpperStr(Histgram) = "YES"

Then

Begin

IF RSIVal >= 50 Then
Plot1(RSIVal - 50, "+RSI_Osc")
Else
Plot2(RSIVal - 50, "-RSI_Osc");
End;

IF UpperStr(Line) = "Y" OR UpperStr(Line) = "YES" Then

Plot3(RSIVal - 50, "RSI_Osc");
Plot4(0, "Even-Line");

IF RSIVal Crosses Below 50 OR RSIVal Crosses Above 50 Then

Alert = True;
The two PaintBar Studies given next also focus on the RSI oscillator, but produce different visual results. When the RSI calculation is above 50, the price bar will be painted blue. When the RSI calculation is below 50, the price bar will be painted red. The color of the price bar indicates the direction of the current/historical trend. When the color changes as a result of an RSI cross above or below zero, an alert will be triggered. Here, then, is the Power Editor code for the two PaintBar Studies:
Type: PaintBar
Name: RSI Above 50
(the color for this PaintBar Study should be set to blue)
Inputs: Price(Close), RSILen(14);
Vars: RSIVal(0);

RSIVal = RSI(Price, RSILen);

IF RSIVal >= 50 Then Begin

Plot1(High, "RSI>=50");

Plot2(Low, "RSI>=50");

End;

IF RSIVal Crosses Above 50 Then

Alert = True;
Type: PaintBar
Name: RSI Below 50
(the color for this PaintBar Study should be set to Red)
Inputs: Price(Close), RSILen(14);
Vars: RSIVal(0);

RSIVal = RSI(Price, RSILen);

IF RSIVal < 50 Then Begin

Plot1(High, "RSI<50");

Plot2(Low, "RSI<50"); End;

IF RSIVal Crosses Below 50 Then
Alert = True;
This code is available at Omega Research's Web site. The file name is "RSIOosc.ELA."

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

GO BACK

METASTOCK

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

GO BACK


TECHNIFILTER PLUS

In this issue's "Using Fibonacci ratios and momentum," Thom Hartle discusses trending and nontrending behavior. In a trending market, price movement is not always in one direction. From time to time, the price will move counter to the dominant trend, retracing part of its recent dominant move. Hartle suggests using these retracements as opportunities to enter positions in the direction of the dominant trend. He measures the current countermove as a percentage of the most recent dominant move, and uses this measurement to decide when and if to take a position. He suggests that reversals of the countermove at levels where the countermove is a Fibonacci ratio (61.8%, 50%, 38.2% and so on) of the prior dominant move portend a resumption of the dominant trend, and hence an opportunity to enter a position.

Below are the formulas for a TechniFilter Plus filter report that allows you to filter for the Fibonacci levels that Hartle suggests using as opportunities to open positions. This report only looks at the long side, but the short side can be handled in a similar manner. Hartle suggests using RSI to decide the current dominant trend. An RSI of less than 50 over a period suggests a dominant downtrend. An RSI of greater than 50 suggests a dominant uptrend. Formula 4 returns whether the current day's RSI is above or below 50. You can use this formula along with TechniFilter Plus's Color Bars tool to mark the bars on a bar chart to quickly distinguish trends. Formula 3 computes the price at which the issue will have to close tomorrow in order for the Rsi to change trends (that is, cross 50) tomorrow. This number provides a way of quantifying how close the issue is to changing trends.

Hartle uses the idea of isolated highs and lows in defining the current major move. Formula 6 returns the highest isolated high among the most recent three isolated highs. Formula 9 returns the lowest isolated low among the three isolated lows that precede the high found in formula 6. Then, formula 10 computes the ratio of the current drop from the high in formula 6 compared with the drop from the high in formula 6 to the low in formula 9, and multiplies it by 100. This formula gives you the retracement percentage. When the countertrend reverses, and this number is close to a Fibonacci level, you may have a buying opportunity.

Retracement Report

FORMULAS

[1] Symbol

[2] Close C

[3] Tar_RSI(14,27,50) ((CG&1>&3)*((&1-1)*(C-CY1)U4X&2*(1-100/&3)+C+(&1-1) *(CY1-C)U4X&2))+((CG&1<=&3)*(C-(&1-1)*(C-CY1)U4X&2 -(&1-1)*&3*(CY1-C)U4X&2/(&3-100)))

[4] Up or Down Trend (CG14>50) - (CG14<50) { 1=uptrend -1=downtrend }

[5] Isolated Highs (H<HY1) * (HY1>HY2) * HY1 { isolated high }

[6] Highest Isolated High [5]U31 % [5]U32 % [5]U33 { highest in 3 } [7] High Location (H=[6]Y000)U8Y000 { days back }

[8] Isolated Lows (L>LY1) * (LY1<LY2) * LY1 * ((CU13Y000-CU13)>[7]) { isolated low prior to high}

[9] Lowest Isolated Low [8]U31 # [8]U32 # [8]U33 { lowest in 3 }

[10] Retracement 100* ([6]-L)/([6]-[9])

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


SMARTRADER

Recreating Thom Hartle's Fibonacci and momentum guidelines in SmarTrader is simple. Here, we'll vary the retracement technique a bit by using the highest high and lowest low over a specified number of periods. This simplifies the way that retracement levels are calculated.

Row 9 is a coefficient where the number of periods is specified. Rows 10 and 11 are math functions to determine the highest high and lowest low. Rows 12, 13 and 14 calculate the retracement levels based on the range of highest and lowest. All five rows are plotted over the bar chart for visual reference.

Row 15 is a 14-period RSI as specified in Hartle's article. The last row is an alarm based on the RSI being greater than 50. A SmartBar plot can be added over the bar chart and made a contrasting color and/or thickness to identify which bars have triggered the alarm.

FIGURE 1: SMARTRADER SPECSHEET. This SmarTrader specsheet implements Thom Hartle's Fibonacci and momentum guidelines.
 

The SmarTrader specsheet file is available from Stratagem's Web site.

-- 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 WAVE WI$E formulas implement Thom Hartle's Fibonacci and momentum guidelines, described elsewhere in this issue. In WAVE WI$E, we'll use the @Decline function to identify and color-code declines of 15% or greater. We'll then identify the most recent major low and compute the Fibonacci retracements from the most recent high to the major low. In addition, the 14-day RSI is color-coded green if it's above 50% and red if below.
WAVE WI$E spreadsheet formulas

A: DATE @TC2000(c:\tc2000\data,DIGI,DSC COMMUNICATIONS CP,DB)

B: HIGH

C: LOW

D: CLOSE

E: OPEN

F: VOL

G:

H: decline @DECLINE(HIGH,LOW,CLOSE,15,1) 'Get chart colors

I: theLo @DECLINE(HIGH,LOW,CLOSE,15,5) 'Find major lows

J: LoRow @ROWOF(@LAST(THELO)); @CELL(#J,@ENDROW())

K: LastLo @IF(@ROW()>LOROW,@LAST(THELO))

L: LastHi @IF(@ROW()>LASTLO,HIGH); @MAXC(LASTHI)

M: R382 @IF(@ROW()>LASTLO,LASTHI - .382*(LASTHI-LASTLO))

N: R500 @IF(@ROW()>LASTLO,LASTHI - .500*(LASTHI-LASTLO))

O: R618 @IF(@ROW()>LASTLO,LASTHI - .618*(LASTHI-LASTLO))

P: rsi @RSI(CLOSE,14)

Q: 50Line 50 R: color @IF(RSI>50,GREEN,RED)

S:
 

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

GO BACK


Return to November Contents