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
WAVEWI$E MARKET SPREADSHEET
TECHNIFILTER PLUS
SMARTRADER
WINDOW ON WALLSTREETor return to June 1998 Contents
Default Settings For NMP Function:
Function Name: NewMarketParadigm
Output: Numeric
Input: Price(NumericSeries),Length(NumericSimple),StdDevUp (NumericSimple),StdDevDn(NumericSimple);
value1 = BollingerBand(Price,Length,StdDevUp);
value2 = BollingerBand(Price,Length,StdDevDn);
Condition1 = value1 < value1[1] and value2 > value2[1]; {Contraction}{Built as conditions for later revision --WD}
Condition2 = value1 > value1[1] and value2 < value2[1]; {Expansion}
Condition3 = Condition1 = False and Condition2 = False; {Transition}
IF Condition1 then NewMarketParadigm = 1; {Contraction}
IF Condition2 then NewMarketParadigm = 2; {Expansion}
IF Condition3 then NewMarketParadigm = 3; {Transition}
New market paradigm indicators
These two indicators can be used to create the distinctive bow-tie formations shown on the charts in the article. They can be applied by inserting them into the same subgraph on any chart. They can also be directly overlaid over the price action, if desired.
Default Settings for Contraction Indicator:
Name: NewMarketParadigm C
Style: BLUE
Input: Price(close),Length(28),StdDevUp(2),StdDevDn(-2);
value1 = BollingerBand(Price,Length,StdDevUp);
value2 = BollingerBand(Price,Length,StdDevDn);
IF NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 1 then begin
Plot1(value1,'''');
Plot2(value2,'''');
End;
Default Settings for Expansion Indicator:
Name: NewMarketParadigm E
Style: RED
Input: Price(close),Length(28),StdDevUp(2),StdDevDn(-2);
value1 = BollingerBand(Price,Length,StdDevUp);
value2 = BollingerBand(Price,Length,StdDevDn);
IF NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 2 then begin
Plot1(value1,'''');
Plot2(value2,'''');
End;
New market paradigm paintbar studies
The following two paintbar studies will paint NMP contraction and expansion bars. By default, all bars that are not painted can be considered NMP transition bars, especially if they occur after an NMP expansion bar.
Default Settings For Expansion Bars:
Name: NMP Expansion
Style: RED
Input: Price(close),Length(28),StdDevUp(2),StdDevDn(-2);
IF NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 2 then begin
Plot1(High,'''');
Plot2(Low,'''');
End;
Default Settings For Contraction Bars:
Name: NMP Contraction
Style: BLUE
Input: Price(close),Length(28),StdDevUp(2),StdDevDn(-2);
IF NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 1 then begin
Plot1(High,'''');
Plot2(Low,'''');
End;
New market paradigm system
This system will eventually be the finished model. It is very flexible, allowing the trader to either write systems based solely on the NMP phases, or plug in existing systems using the NMP as a filter.
Setting Defaults for NMP system:
Name: NMP SYSTEM
Stops: None
Properties: Check "Allow multiple entries...." and "Generate orders for next bar"
Input: Price(close),Length(28),StdDevUp(2),StdDevDn(-2);
Vars: NmpC(0),NmpE(0),NmpT(0),Trigger(0);
{*1.}
If NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 1 then NmpC = NmpC + 1
Else NmpC = 0; {Contraction phase}
If NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 2 then NmpE = NmpE + 1
Else NmpE = 0; {Expansion Phase}
If NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 3 then NmpT = 1
Else NmpT = 0; {Transition Phase}{Reversal traders will be using this phase, so I left it in, although I donÕt use it. No Counter is implemented, but one could certainly do that Ñ WD}
{*2.}
Condition1 = NmpE > 1; {2 consecutive NmpE ranges qualify as an Expansion Phase. -- WD}
If Condition1 then begin
Trigger = 1;
End;
{*3.}
If Trigger = 1 then begin
Buy Highest(High,10) + 1 point Stop;
Sell Lowest(Low,10) - 1 point Stop;
End;
Notes to the code
1 First, write a set of algorithms that will make the rather lengthy NMP function strings easy to work with. Note that a counter has been added to the contraction and expansion strings. This counter holds a short-term record of the number of consecutive occurrences. Use the counts in constructing the system.
2 Next, establish the basic setup that will allow our systems to recognize a forming NMP state.
3 The following code implements a simple intraday channel breakout system. Many market false breakouts can be eliminated by changing this to a channel break "on close only" system. Once the trigger has been set to "1," it will remain in that state. In the initial testing phases, this experiments with phasing a simple system into the market. The theory is that by introducing a system into the market at the right time, it should be in sync with prevalent market cycles.
The original CIS bow-tie/parabolic
Setting Defaults for NMP system:
Name: NMP SYSTEM
Stops: None
Properties: Check "Do not allow multiple entries" and "generate orders for next bar"
Input: Price(close),Length(28),DevSet(2),Accfactr(.02);
value1 = StdDev(Price,Length)*DevSet - StdDev(Price,Length)*-DevSet;
If value1 = Lowest(value1,Length) and Adx(14) < 23 then begin
IncludeSystem: "Parabolic",ACCFACTR;
End;
New Market Paradigm
HIGHLIGHTS
Name: Contraction
Condition: BBandTop(CLOSE,28,SIMPLE,2)< Ref(BBandTop (CLOSE,28,SIMPLE,2),-1) AND
BBandBot(CLOSE,28,SIMPLE,2)> Ref(BBandBot(CLOSE,28, SIMPLE,2),-1)
Color: Blue
Name: Expansion
Condition: BBandTop(CLOSE,28,SIMPLE,2) > Ref(BBandTop (CLOSE,28,SIMPLE,2),-1) AND
BBandBot(CLOSE,28,SIMPLE,2)< Ref(BBandBot(CLOSE,28, SIMPLE,2),-1)
Color: Red
Click OK to save the changes to the Expert. Open a chart and then click your right-mouse button while pointing at the chart heading. Choose Expert Advisor and then choose Attach from the chart shortcut menu. Choose the New Market Paradigm Expert and then click the OK button. The price bars in the chart will be highlighted blue during a contraction phase and red in an expansion phase.
The formulas for the NMP filter on a price chart, with dynamic color bars, to highlight how the filter alone identifies contraction, expansion and transition points are as follows:
A: DATE @TC2000(c:\tc2000\data,SP-500,STANDARD & POORS 500,DB)
B: HIGH
C: LOW
D: CLOSE
E: OPEN
F: VOL
G: Avg @MAVG(CLOSE,21)
H: HiBand AVG+2*@STD(CLOSE,21)
I: LoBand AVG-2*@STD(CLOSE,21)
J: Con1 @IF(HIBAND<HIBAND[-1] & LOBAND>LOBAND[-1],1)
K: Con2 @IF(HIBAND>HIBAND[-1] & LOBAND<LOBAND[-1],2)
L: Con3 @IF(@ISBLANK(CON1)=1 & @ISBLANK(CON2)=1,3)
M: Color @IF(CON1=1,GREEN, @IF(CON2=2,RED,YELLOW))
==========End Formulas
The second half of the formula looks for the expansion phases in a similar manner. Subtracting the results of these two terms yields a single formula that returns a "1," "-1" or zero, depending upon the phase.
Visit RTR Software's Web site to download a copy of this formula.
NAME: NMP
FORMULA: ( (CA28+2*C|28) < TY1 ) *
( (CA28-2*C|28) > TY1 ) - ( (CA28+2*C|28) > TY1 ) *
( (CA28-2*C|28) < TY1 )
Row 13 is a counter that is used to implement counting the number of bars where each condition is true. Row 14, condition1, is true whenever the bands are contracting. Row 15, NmpCstart, is only true when a contraction starts. Its purpose is to capture and retain the value of offset when a contraction begins. Row 16, NmpCcount, calculates the difference of offset and NmpCstart plus 1 to count the periods when there is a contraction. Row 17, NmpC, returns the value of NmpCcount only while the contraction continues. This process is repeated for condition2 and condition3.
An alarm is necessary to plot a different color/thickness over a bar. This is a smartbar. Alarmblue is true if condition1 is true. Alarmred is true when condition2 is true. In the barchart window, smartbar plots are added for Alarmblue and Alarmred. These plots are set for a slightly thicker density than the bar chart itself to further enhance their appearance.
A second window contains a line plot of value1 and value2, the Bollinger bands. A range plot is used to fill between the bands where condition1 and condition2 are true. The range plot plots from point to point within a period, and in this case, from value2 to bluefill, which has the same value as value1 when condition1 is true and from value2 to redfill, which has the same value as value1 when condition2 is true. The specsheet for this system is available at Stratagem's Web site.
FIGURE 1: SMARTRADER. This SMARTrader specsheet implements the NMP indicator.
GO BACKWINDOW ON WALLSTREET
Walter Downs describes a new market paradigm and a way to spot expansion and contraction. He models this around Bollinger bands. This can be implemented in Window On WallStreet Day Trader and Window On WallStreet Professional Investor.
In Window On WallStreet, begin with any open chart on your screen. Click the Indicator button on the toolbar, click New and enter the following formulas:
New Market Paradigm
Name: New Market Paradigm
Description: Walter Downs's New Market Paradigm from Technical Analysis of Stocks & Commodities.
Variables:
Name: persFormula(s):Prompt Text: Enter Number of Periods for Moving Avg
Default Value: 28
Name: devs
Prompt Text: Enter Number of deviations
Default Value: 2.0
if(mov(c,pers,e) + std(c, pers,devs) < ref(mov(c,pers,e) + std(c,pers,devs),-1) ANDmov(c,pers,e)-std(c,pers,devs)> ref(mov (c,pers,e)- std(c, pers,devs) ,-1), 1 , if(mov(c,pers,e) + std(c, pers,devs) >ref(mov(c,pers,e) + std(c, pers,devs) ,-1) AND mov(c,pers,e) - std(c,pers,devs) < ref(mov(c,pers,e) - std(c, pers,devs) ,-1), 2 , 3))
New Market Paradigm Alerts
Name: New Market Paradigm (Alert)
Description: Walter Down's New Market Paradigm from Technical Analysis of Stocks & Commodities. Marker above bar is a contraction. Marker below bar is an expansion.
Variables:
Name: persPrompt Text: Enter Number of Periods for Moving Avg
Default Value: 28
Name: devsFormula(s):Prompt Text: Enter Number of deviations
Default Value: 2.0
1 alertmarker( if(mov(c,pers,e) + std(c, pers,devs) < ref(mov(c,pers,e) +std(c, pers,devs) ,-1) AND mov(c,pers,e) - std(c, pers,devs) >ref(mov(c,pers,e) - std(c, pers,devs) ,-1), 1 , if(mov(c,pers,e) + std(c,pers,devs) > ref(mov(c,pers,e) + std(c, pers,devs) ,-1) AND mov(c,pers,e)- std(c, pers,devs) < ref(mov(c,pers,e) - std(c, pers,devs) ,-1), 2 , 3))= 1.0, above)
2 alertmarker( if(mov(c,pers,e) + std(c, pers,devs) < ref(mov(c,pers,e) +std(c, pers,devs) ,-1) AND mov(c,pers,e) - std(c, pers,devs) >ref(mov(c,pers,e) - std(c, pers,devs) ,-1), 1 , if(mov(c,pers,e) + std(c,pers,devs) > ref(mov(c,pers,e) + std(c, pers,devs) ,-1) AND mov(c,pers,e)- std(c, pers,devs) < ref(mov(c,pers,e) - std(c, pers,devs) ,-1), 2 , 3))= 2.0, below)
-- Andrew E. Laska, Window On WallStreet888 732-5969, 972 783-6792Internet: https://www.wallstreet.netGO BACK