Candle Code
Candle - Hanging Man/Hammer and CCI Trading System
Candle Shadow Support
CCI Spike Trading System
Chande and Kroll's R2 Indicator
Chandlier Exit
Chandelier Exit 2
Chandeleir Exit, version II
Changing Ways Accumulation/Distribution
Channel Exit with Stop Loss
Cleaning out unwanted stocks from Metastock
Close Above Median Price
CMA

Coding Example
Candle Strength Index
Chande Momentum Oscillator Composite Average
Chande Momentum Oscillator Volatility
Chande's Momentum Oscillator
Collection from a Spanish Source
Common Metastock Bar Patterns
Congestion Index
Connors & Raschke's Historical Volatility System
Consolidation Breakout, Downside
Consolidation Breakout, Upside
Consolidation Over 16 Weeks
Countback line for Metastock
Create a Gann Swing Expert
Creating Dynamic Vertical Lines
Cross Above 200 MA on Twice Average Volume
Crossing Below 200 Day MA on Double Average Volume
Customisable StochRSI from Nicholas Kormanik
Cyclical System

Chande's Trendscore
Comparitive Relative Strength in MetaStock™ for Windows
Confidence %
Coppock Curve

 

Candle Code

From "Lyn Maine"
Here is the formula from this months TASC called Candle code
this is only using 1 formula not like the one in TASC which is broken up into several smaller ones.

CandleCode
Bdy:=Abs(O-C);
Lshd:=If(C>=O,O-L,C-L);
Ushd:=If(C>=O,H-C,H-O);
ThBotB:=BBandBot(Bdy,55,E,0.5);
ThTopB:=BBandTop(Bdy,55,E,0.5);
ThBotL:=BBandBot(Lshd,55,E,0.5);
ThTopL:=BBandTop(Lshd,55,E,0.5);
ThBotU:=BBandBot(Ushd,55,E,0.5);
ThTopU:=BBandTop(Ushd,55,E,0.5);
CCode:=If(C=O,1,0)*If(Ushd>=Lshd,64,48)+If(C=O,0,1)*(If(C>O,1,0)*(If(Bdy<=ThBotB,80,0)+If(Bdy>ThBotB AND Bdy<=ThTopB,96,0)+ If(Bdy>ThTopB,112,0))+ If(C<O,1,0)*(If(Bdy<=ThBotB,32,0)+ If(Bdy>ThBotB AND Bdy<=ThTopB,16,0)))+(If(Lshd=0,3,0)+ If(Lshd<ThBotL AND Lshd>0,2,0)+ If(Lshd>ThBotL AND Lshd<=ThTopL AND Lshd>0,1,0))+(If(Ushd>0 AND Ushd<=ThBotU,4,0)+ If(Ushd>ThbotU AND Ushd<=ThTopU,8,0)+ If(Ushd>ThTopU,12,0));
CCode;


CSI{Candle strength index}
Periods:=Input("Enter Periods",2,13,2);
Mov(Mov(Mov(Fml("Candlecode"),Periods,S),Periods,S),Periods,S)

(Go Top)

Candle - Hanging Man/Hammer and CCI Trading System

enter long:
(Fml("Candle - Hammer")=1) AND
(CCI(11)<-50)

close long:
((CCI(11)<80) AND
(Ref(CCI(11),-1)>80)) OR
((CCI(11)<-80) AND
Ref(CCI(11)>-80,-1))

enter short:
(Fml("Candle - Hanging Man'")=-1) AND
(CCI(11)>50)

close short:
((CCI(11)>-80) AND
(Ref(CCI(11),-1)<-80)) OR
((CCI(11)<80) AND
Ref(CCI(11)>80,-1))

(Go Top)

Candle Shadow Support

This is a custom - made Formula based on Candlesticks called CANDLE SHADOW SUPPORT - RESISTANCE (by John D. Kontessis) Based on extensive study of the following books "Japanese Candlestick Charting Techniques", S.Nison, 1991 "Beyond Candlesticks" S.Nison, 1994 "Tehcical Analysis" X.E. Kourouklis, METAPUBLICATIONS (in greek language only) As we all know, one of the most important components of a candlestick is its shadow. A candle's shadow tends to get longer as prices get closer to support-resistance levels, as well as when they reach points of change in Trend (e.g. pullbacks or entry in ranging periods). As prices reach a Support level (or when building a support) the candles' lower shadows get longer. Consequently, as prices reach a Resistance Level (or when building a resistance) the candles' upper shadows get longer. The obvious problem that an analyst faces is that such subtle changes are difficult to discern and evaluate by naked eye only.

This problem can be easily solved by using the following two Formulas in Metastock's Indicator Builder. After Opening the "Indicator Builder", choose "New" and name the Formula : "CandleShadow Resistance ", enter the following :

ShadowResistance:=If(OPEN<CLOSE,(HIGH-CLOSE),(HIGH-OPEN));
Mov(ShadowResistance,3,S); {for not so short-term results, use:
Mov(ShadowResistance,10,w)}
and press "ok".

Now let's build the second Formula: After Opening the "Indicator Builder", choose "New" and name the Formula : "CandleShadow Support", enter the following :

ShadowSupport:=If(CLOSE>OPEN,(OPEN-LOW),(CLOSE-LOW)); Mov(ShadowSupport,3,S); {for not so short-term results, use: Mov(ShadowSupport,10,w)} and press "ok".

So far we have built two Formulas, who, after measuring the shadows of the candles in our chart, they "draw" a 3-Day Mov.Average of the size of the shadows (or alternatively a 10day weighted Mov.Average). The first Formula "CandleShadow Resistance" measures the upper shadow and the second Formula "CandleShadow Support" measures the lower shadow. You can always experiment with the type of Mov.Averages (simple, weighted, exponential etc) and the periods used so as to achieve the best "optical" results. Now let's see these Formulas at work. In an UPTREND : Higher Tops in "CandleShadow Resistance " and simultaneously lower tops in "CandleShadow Support" , state a weakness of the uptrend.(bearish signal). Lower Tops in "CandleShadow Resistance " and simultaneously higher tops in "CandleShadow Support" , state a strength of the uptrend. (bullish signal). In a DOWNTREND : Higher Tops in "CandleShadow Resistance " and simultaneously lower tops in "CandleShadow Support" , state a strength of the downtrend. (bearish signal). Lower Tops in "CandleShadow Resistance " and simultaneously higher tops in "CandleShadow Support" , state a weakness of the downtrend. (bullish signal). At your disposal for any questions or comments. John D.

(Go Top)

CCI Spike Trading System

{This system uses the momentum Commodity Channel Index (CCI) indicator to
find short-term bottoms in the market. The CCI indicator is extremely
volatile and is generally difficult to use when trading the S&P 500 Index.
We, however, have turned this volatility into a trading advantage by using
the spread or gap between the CCI index and its moving average as a reversal
signal. Specifically if the gap is larger then a certain percentage and CCI
indicator crosses above its moving average we buy the market. The system
remains in the market for a short period of time, exiting the trade as the
indicators cross to the downside. As designed, this system only trades long
the market; it can however be altered to short the market. It is best used
in choppy bullish markets similar to the 1995 bull market.}

{Trading Tactics: This short-term bullish trading system exploits over
extended markets. Futures, options, and mutual fund traders should take full
advantage of this high probability trading system, either by taking outright
positions or avoiding declining markets. The code for this system can be
reversed to trade short positions. This system should be used in place of
longer-term momentum systems in strong bullish choppy type markets. This
system rarely exits at the market intermediate peak, so other exiting
signals may be used in place of our indicator crossover technique.}

{Enter long:}

Ref(CCI(13)/(Mov(CCI(13),3,S)),-1)>1.5 AND
Cross(CCI(13),(Mov(CCI(13),3,S))) AND
Ref(CCI(13),-1)<-25

{Exit long:}

Cross((Mov(CCI(13),3,S)),CCI(13)) AND
Ref(CCI(13),-1)>200

(Go Top)

Chande and Kroll's R2 Indicator

rev. 01/06/97

In their book "The New Technical Trader," Chande & Kroll introduce the r2
indicator. They state that
"the primary use of r2 is as a confirming indicator" and that "it is a
lagging indicator that shows
the strength of the trend."

In MetaStock the r2 formula is:

Pwr(Corr(Cum( 1 ),C,14,0),2)

They also present a smoothed r2 which would be:

Mov(Pwr(Corr(Cum( 1 ),C,14,0),2)*100,14,S)

(Go Top)

Chande and Kroll's R2 Indicator

rev. 01/06/97

In their book "The New Technical Trader," Chande & Kroll introduce the r2
indicator. They state that
"the primary use of r2 is as a confirming indicator" and that "it is a
lagging indicator that shows
the strength of the trend."

In MetaStock the r2 formula is:

Pwr(Corr(Cum( 1 ),C,14,0),2)

They also present a smoothed r2 which would be:

Mov(Pwr(Corr(Cum( 1 ),C,14,0),2)*100,14,S)

(Go Top)

Chandelier Exit 2

Here is the Fast Chandelier Exit in full as supplied to me. It is part of an exit strategy which you can adjust to your own trading style and comfort levels. from Ian Burgoyne

HHVDays:=Input("Days Since Trade Opened",1,300,1);

ATRDays:=Input("ATR Days",1,30,10);

ATRHighMult:=Input("ATR Multiplier From High",1,5,3.0);

ATRCloseMult:=Input("ATR Multiplier From Close",1,5,2.5);

HHVStop:= HHV(H,HHVDays) - ATRHighMult*ATR(ATRDays);

HighStop:= H - ATRHighMult*ATR(ATRDays);

CloseStop:= C - ATRCloseMult*ATR(ATRDays);

TodaysCalc:= If(HighStop > CloseStop, HighStop, CloseStop);

TodaysStop:= If(L <= PREV, TodaysCalc, If(HHVStop < PREV, PREV,
If(HHVStop >
C,PREV,HHVStop)));

HHVDays:=Input("Days Since Trade Opened",1,300,1);
ATRDays:=Input("ATR Days",1,30,10);
ATRHighMult:=Input("ATR Multiplier From High",1,5,3.0);
ATRCloseMult:=Input("ATR Multiplier From Close",1,5,2.5);
HHVStop:= HHV(H,HHVDays) - ATRHighMult*ATR(ATRDays);
HighStop:= H - ATRHighMult*ATR(ATRDays);
CloseStop:= C - ATRCloseMult*ATR(ATRDays);
TodaysCalc:= If(HighStop > CloseStop, HighStop, CloseStop);
TodaysStop:= If(L <= PREV, TodaysCalc, If(HHVStop < PREV, PREV,
If(HHVStop >C,PREV,HHVStop)));
TodaysStop

(Go Top)

Chandeleir Exit, version II

Below is the MetaStock code I posted for the Chandelier exit back in October, 1999. The trick is to define the entry date/price as the point at which your system triggered the entry, not by using the date functions. A side benefit is that you can also use it to implement a fixed dollar, or money management, stop.

The more time I spend with the Chandelier exit, the more I admire its strength as an exit and its simplicity. Because exits tend to be the weakest part of a system, I would urge everyone to spend some time with it.

And Chuck LeBeau gets credit for the MetaStock code, not me. I just took his framework and applied it to his exit.


{LONG EXIT}
LongEntry:= {this your entry system, eg. Cross(CLOSE, Mov(C,20,E))};
MoneyMgmtStop:= {this is your maximum loss, in points};

{DEFINE ENTRY PRICE, WITH EXIT BEING -- ENTRY PRICE AND NO TRADE BEING 0}
EntryPrice:= If(PREV <= 0,
{Trade entered today?}
If(LongEntry, CLOSE, 0),
{Trade entered before today. Stopped today?}
If(LOW <= PREV - MoneyMgmtStop, -PREV,
If(LOW <= HighestSince(1,PREV=0, HIGH) - 3 * ATR(10), -PREV,
If(LOW <= HighestSince(1,PREV=0, CLOSE) - 2.5 * ATR(10), -PREV,
PREV))));

{EXIT IF ENTRY PRICE < 0 (MEANING EXIT)}
EntryPrice < 0

{SHORT EXIT}
ShortEntry:= {this your entry system, eg. Cross(Mov(C,20,E), CLOSE)};
MoneyMgmtStop:= {this is your maximum loss, in points};

{DEFINE ENTRY PRICE, WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0}
EntryPrice:= If(PREV <= 0,
{Trade entered today?}
If(ShortEntry, CLOSE, 0),
{Trade entered before today. Stopped today?}
If(HIGH >= PREV + MoneyMgmtStop, -PREV,
If(HIGH >= LowestSince(1,PREV=0, LOW) + 3 * ATR(10), -PREV,
If(HIGH >= LowestSince(1,PREV=0, CLOSE) + 2.5 * ATR(10), -PREV,
PREV))));

{EXIT IF ENTRY PRICE < 0 (MEANING EXIT)}
EntryPrice < 0

(Go Top)

Changing Ways Accumulation/Distribution

This is the calculation for the first formula (Todays Change):
Todays close - yesterdays close

This is the main formula, incorporating the first calculation:
If todays change (1st formula) is greater than a 7 day exponential moving average of todays change and todays close is greater than yesterdays close, write down todays close + todays volume, otherwise,
If todays change is less than a 7 day exponential moving average of todays change and todays close is less than yesterdays close, write down the negative value of todays close + todays volume, otherwise write down 0.

Then add up all the days values and keep a cumulative running total for each new trading day.

Simple Interpretation:
Changing Ways Accumulation/Distribution can show divergences against the instrument.
When compared against volume activity, it can show what impact a day of high turnover had on the share price for the coming periods. This is to say that if a day had high volume and there was little movement in the indicator alongside this, then you can suggest that all the volume for that day was absorbed into the price and there is less likelihood of buying/selling pressure in that day taking hold in the market in future trading days.

Metastock code for Changing Ways Accumulation/Distribution:

Cum(If(Fml( "Todays Change" ) > Mov(Fml( "Todays Change" ),7,E) AND C > Ref(C,-1),
C + V,
If(Fml( "Todays Change" ) < Mov(Fml( "Todays Change" ),7,E) AND C < Ref(C,-1),
Neg(C + V) ,0)))

Where Fml( "Todays Change" ) = c - ref(c,-1)

(Go Top)

Channel Exit with Stop Loss

As people have mentioned before, it is difficult to design exits in MetaStock because of the awkwardness of defining your trade entry price. One exit system that requires your trade entry price is the channel exit.

For those not familiar with it, the channel exit is quite a straight forward trailing stop. Once you're in a trade (let's say, long), you maintain your stops at the lowest low of the past number of days (optimized, in the code below) until you are taken out of the market. This method attempts to let profits run in the direction of the trend, but takes you out when price makes a significant reversal and you risk giving back profits on a retracement or the end of the trend.

Below is the code for a channel exit. It also includes a money management stop to limit losses to an acceptable level until the channel exit exceeds it. Work on variations of this basic theme, such as moving the stop up faster where the market makes rapid gains and your lowest low in, say, 10 or 20 days is just too far away to adequately protect profits.

Glen Wallace

{LONG EXIT}
LongEntry:= {this your entry system, eg. Cross(CLOSE, Mov(C,20,E))};
MoneyMgmtStop:= {this is your maximum loss, in points};

{DEFINE ENTRY PRICE, WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0}
EntryPrice:= If(PREV <= 0,
{Trade entered today?}
If(LongEntry, CLOSE, 0),
{Trade entered before today. Stopped today?}
If(LOW <= Max(PREV - MoneyMgmtStop, Ref(LLV(LOW,opt1),-1)), -PREV,
PREV));

{EXIT IF ENTRY PRICE < 0 (MEANING EXIT)}

EntryPrice < 0


{SHORT EXIT}
ShortEntry:= {this your entry system, eg. Cross(Mov(C,20,E), CLOSE)};
MoneyMgmtStop:= {this is your maximum loss, in points};

{DEFINE ENTRY PRICE, WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0}
EntryPrice:= If(PREV <= 0,
{Trade entered today?}
If(ShortEntry, CLOSE, 0),
{Trade entered before today.Stopped today?}
If(HIGH >= Min(PREV + MoneyMgmtStop, Ref(HHV(HIGH,opt1),-1)), -PREV,
PREV));

{EXIT IF ENTRY PRICE < 0 (MEANING EXIT)}
EntryPrice < 0

(Go Top)

Cleaning out unwanted stocks from Metastock

A fast method to clean out unwanted stocks from Metastock and also save them for future viewing.
On your hard drive, create a series of folders and sub folders like your present Metastock data system. In my case OLD_META_DATA/ALL01/A01,B01,C01 etc to Z01. (Be sure no more than 450 stocks go in each folder when you do copy/deletions)
Open METASTOCK/Tools/DOWNLOADER and once in DOWNLOADER open Tools/Copy .
Browse to the folder you wish to make deletions from.
In the "Copy Securities" window make sure you can read the Last Date column with the Name column showing. If not,do not use the scroll bar but place the cursor in the Name box at its RH end almost in the Symbol box and when your cursor turns into a cross hold down the LH button on the mouse and drag it left thereby narrowing the Name column till the Last Date column is visible.( This is also a good tip when printing out Metastock reports that do not fit on the width of an A4 page, just reduce the width of a column or eliminate it completely if it is not wanted on the print out.)
Hold down the Control key and highlight each Name you wish to delete. I go on the Last Date column to find useless stocks. If you use the scroll bar to go down the list be sure not to let go of the control key as you will lose all your previous selections.
When finished highlighting let go of control key and press copy. Browse to the new folder you created, tick the "Delete Source Security" box and press OK. Old securities gone out of current data base and saved for future reference. You can do hundreds in a matter of minutes. If you want to ever see the old securities just alter the lead folders names in explorer.
From Basil Holloway

(Go Top)

Close Above Median Price

This exploration is designed to find those stocks where the close is above the median price over the past five days. It matches the steps in Dels bvook The Strategic Electronic Day Trader.
col a = CLOSE - MP()
col b = (Ref(CLOSE,-1))-(Ref( MP() ,-1))
Col c = (Ref(CLOSE,-2))-(Ref( MP() ,-2))
col d = (Ref(CLOSE,-3))-(Ref( MP() ,-3))
col e = (Ref(CLOSE,-4))-(Ref( MP() ,-4))
filter = colA>=0 AND colB>=0 AND colC>=0 AND colD>=0 AND colE>=0
    The filter in the exploration only shows those stiocks that have the strongest bullish bias over all 5 days. By removing the filter all stocks will be shown. Ranking the first colum will then allow you to estaboish the overall score for each stock.

(Go Top)

CMA

"1) Sell the opening (long or short) X-number of days(?) after the indicator above moves from below 100 to
above 100. (Is this on a close-to-close basis?)"

Specifically, sell the opening the day after the BB Histo closes above 100.

"2) Buy or cover when the indicator goes from above 100 to below 100 or from above 0 to below 0 X-number
of days after that occurs."

Buy, when the BB Histo dips below zero (the following morning).

"a) how many days after the signal does one act;"

The following morning.

" b) Is this close-to-close or intra-day?"

close to close

"c) Is this to initiate or to go short or add to a position?"

Add to positions if the indicator "repenetrates" these levels ... otherwise, reverse when it triggers

(Go Top)

Coding Example

If yesterdays high is greater than the high of 2 days ago// and the low 5 days ago is less than or equal to the high 4 days ago// and it is Wednesday
Try this:
Ref(H,-1)>Ref(H,-2) AND
Ref(L,-5)<=Ref(H,-4) AND
Dayofweek() = 3

(Go Top)

Collection from a Spanish Source

They are contributed by Patrick who notes "my limited Spanish suggests that they are simply a random collection made by the web owner, who points out that there is as yet 'no Holy Grail' in technical analysis! For the past few days I have been using them by substituting the for 'number' given to each formula, the complete formula that particular number represents. In this way, each becomes independent." We have included all 80 of them, complete with the orginal Spanish cover note.
A continuaciуn se ofrecen una serie de fуrmulas que puede utilizar con el programa Metastock recogidas de la red y cuya utilidad Vd. debe valorar. Se ruega encarecidamente a todos aquellos que tengan fуrmulas que puedan resultar ъtiles las envнen a jomaba@interbook.net para su publicaciуn en esta pбgina. Muchos dicen que el Santo Grial no existe.їY si es mentira?

1 DAILY CLOSE VS HIGH AND LOW WAVE if((C-L)/(H-L),>,.66 ,1, if((C-L)/(H-L),<,.38,-1,0))
2 PRICE OSCILLATOR WAVE if(ref(oscp(3,15,S,%),-1),<,0,1,0)
3 VOLUME OSCILLATOR WAVE if(oscv(1,50,S,%),>,50,1,0)
4 WEEKLY PRICE OSCILLATOR WAVE if(fml(#17),>,ref(fml(#17),-1),1, if(fml(#17),<,ref(fml(#17),-1),-1,0))
5 VOLATILITY WAVE if(ref(fml(#27),-1),<,90,1,0)
6 LONG BINARY WAVE fml(#1) + fml(#2) + fml(#3) + fml(#9)
7 STOCHASTIC WAVE - LONG if(ref(stoch(14,3),-1),=,llv(stoch(14,3),3),2, if(stoch(14,3),=,llv(stoch(14,3),3),1,0))
8 STOCHASTIC WAVE - SHORT if(ref(stoch(14,3),-1),=,hhv(stoch(14,3),3),2, if(stoch(14,3),=,hhv(stoch(14,3),3),1,0))
9 VOLATILITY DIFFERENCE WAVE if(fml(#11),>=,1.00,1,0)
10 LONG BINARY II fml(#1) + fml(#3) + fml(#9) + fml(#24)
11 VOLATILITY DIFFERENCE mov(H-L,1,S)/mov(H-L,20,S)
12 HI LOW WAVE - DAILY if(H,>,ref(hhv(H,100),-1),1,if(L,<,ref(llv(L,100),-1),-1,0))
13 WEEKLY HIGH LOW WAVE if(H,>,ref(hhv(H,40),-1),1, if(L,<,ref(llv(L,40),-1), -1,0))
14 PERCENT ABOVE\BELOW MOVING AVG (oscp(1,30,E,%))
15 WEEKLY PRICE OSCILLATOR mov(oscp(10,20,S,%),10,S)
16 MACD WAVE MACD/trigger Binary Wave if(macd(), >, mov(macd(),9,E), {bullish} +1, {bearish} -1)
17 WEEKLY OSC SEGMENT mov(oscp(43,86,S,%),43,S)
18 HISTORICAL VOLATILITY (std(log(C / ref(C,-1)),10)*sqr(365)) /(std(log(C / ref(C,-1)),50)*sqr(365))
19 RELATIVE STRENGTH C/P
20 CLOSE REL TO HIGH LOW (C-L)/(H-L)
21 GAP IDENTIFICATION if(L,>,ref(H,-1),1, if(H,<,ref(L,-1),-1,0))
22 AVG VOLUME mov(V,50,S)
23 MOVE WAVE 20-unit m.a. Binary Wave if(C, >, mov(C,20,E), {then bullish} +1, {else bearish} -1)
24 STOCHASTIC VALUE WAVE if(ref(stoch(14,3),-1),<,65,1, if(stoch(14,3),<,65,1,0))
25 ROC WAVE 12-ROC price Binary Wave if(roc(C,12,%), >, 0, {then bullish} +1, {else bearish} -1)
26 STOCH WAVE 5- Stochastic Binary Wave if(stoch(5,3), >, 50, {then bullish} +1, {else bearish} -1)
27 ATR RATIO atr(10)/atr(50)/100
28 BINARY WAVE Composite Wave of above fml("MACD Wave") + fml("MOVE Wave") + fml("ROC Wave")+ fml("STOCH Wave")
29 WEEKLY OPEN CLOSE WAVE if(C,>,O,1,if(C,<,O,-1,0))
30 SHORT BINARY WAVE fml(#31) + fml(#32) + fml(#33)
31 SHORT OPEN CLOSE WAVE if((C-L)/(H-L),<,.38,1,0)
32 SHORT PRICE OSCILLATOR WAVE if(ref(oscp(3,15,S,%),-1),>,0,1,0)
33 SHORT VOLUME WAVE if(oscv(1,50,S,%),>,0, if(V,>,ref(V,-1),1,0),0)
34 O.B.V. Good example of if() func cum( if( C, >, ref(C,-1), +V, if( C, <, ref(C,-1), -V, 0) ))
35 SINE WAVE 5-unit standing sine wave sin( cum(5) )
36 STOCHASTIC Example of hhv() function ( sum( C - llv(L,5), 3 ) / sum( hhv(H,5) - llv(L,5), 3) ) * 100
37 Median price (hhv(H,10)-C)-(C-llv(L,10))/(hhv(H,10)-llv(L,10))
38 Future MACD---Dr. Trieber (C-(( 11.607*(mov(C,26,E)))-(10.607*(mov(C,12,E))) -(12.536*(mov(macd(),9,E)))))
39 Fraction (32nd's) int(C)+((frac(C)/0.03125)/100)
40 Summation Noise Indicator (Adam White) (sum(abs(C-ref(C,-1)),14)-sum(abs(mov(C,10,S)-ref(mov(C,10,S),-1)),14))/
sum(abs(C-ref(C,-1)),14)
41 Chaikin Money Flow sum(((((C-L)-(H-C))/(H-L))*V),21)/sum(V,21)
42 Linear Regression ((15*(sum(cum(1)*C,10))-(sum(cum(1),10)*(sum(C,10))))
/((10*sum(pwr(cum(1),2 ),10))-pwr(sum(cum(1),2),10))
-pwr(sum(cum(1),10),2))
43 Smoothed Tick Momemtum Line-TASC mov(roc(cum(if(C,>,ref(mov(C,10,E),-1),+1,
if(C,<,ref(mov(C,10,E),-1),-1,0))),5,$),5,E)
44 Bull Power (for Elderray) H-mov(C,13,E)
45 Bear Power (for Elderray) L-mov(C,13,E)
46 13-Period Moving Average (for Elderray) mov(C,13,E)
47 RSI Binary Wave (using 30/70 xover) if(rsi(10),>,30,if(ref(rsi(10),-1),<,30,+1,if(rsi(10),<,70,if(ref(rsi(10),- 1),>,70,-1,0),0)),0)
48 Trendscore...Tushar Chande (TASC) if(C,>=,ref(C,-11),1,-1)+if(C,>=,ref(C,-12),1,-1)+if(C,>=,ref(C,-13),1,-1)+
if(C,>=,ref(C,-14),1,-1)+if(C,>=,ref(C,-15),1,-1)+if(C,>=,ref(C,-16),1,-1)+
if(C,>=,ref(C,-17),1,-1)+if(C,>=,ref(C,-18),1,-1)+if(C,>=,ref(C,-19),1,-1)+
if(C,>=,ref(C,-20),1,-1)
49 KST-Martin Pring (One formula) (mov(roc(C,10,%),10,S))+(2*(mov(roc(C,15,%),10,S)))+
(3*(mov(roc(C,20,%),10,S)))+(4*(mov(roc(C,30,%),15,S)))/10
50 Dual Oscillator B-Wave +1 buy, -1 sell if(fml("dual osc 1"),>,fml("dual osc 2"),if(ref(fml("dual osc 1"),-1),<,
ref(fml("dual osc 2"),-1),+1,if((fml("dual osc 1")),<,fml("dual osc 2"),
if(ref(fml("dual osc 1"),-1),>,ref(fml("dual osc 2"),-1),-1,0),0)),0)
51 Dual Osc 1 mov(C,2,S)-mov(C,10,S)
52 Dual Osc 2 mov((H+L+C)/3,5,S)-mov((H+L+C)/3,20,S)
53 R Squared pwr(corr(cum(1),C,5,0),2)
54 Slope of Linear Regression Line ((5*(sum(cum(1)*C,5)))-(sum(cum(1),5)*(sum(C,5))))/
((5*sum(pwr(cum(1),2),5))-pwr(sum(cum(1),5),2))
55 RWI for today's high (H-ref(L,-16))/(mov((H-L),16,S)*sqr(16))
56 RWI for today's low (ref(H,-16)-L)/(mov((H-L),16,S)*sqr(16))
57 Momemtum roc(mov(C,10,E),10,%)
58 Volume Binary Wave if(V,>,ref(mov(V,20,E),1),1,if(V,<,ref(mov(V,10,E),1),-1,0))
59 MACD w/SAR if(macd(),>,mov(macd(),9,E),{macd is above trigger}if(sar(.02,.2),
<,C,{buy long}+2,{stop shorts}+1),{macd < trigger}if(sar(.02,.2),>,
C,{sell short}-2, {stop longs}-1))
60 Oscillating OBV mov(obv(),20,E)-obv()
61 Overreaction Index if(ref(std(C,3),-3),>,4,+1,0)+if(C,<,(sar(.015,.15)),-1,+1)
62 Modified MACD tsf(C,12)-tsf(C,26)
63 RVI w/simple moving average (TASC) 100*mov(if(C,>,ref(C,-1),std(C,10),0),14,S)/(mov(if(C,>,ref(C,-1),
std(C,10),0),14,S)+mov(if(C,<,ref(C,-1),std(C,10),0),14,S))
64 Upper Bollinger Band mov(C,20,S)+(2*(std(C,20)))
65 Lower Bollinger Band mov(C,20,S)-(2*(std(C,20)))
66 Middle Band mov(C,20,S)
67 %B (TASC) (C-(mov(C,20,S)-(2*(std(C,20)))))/(mov(C,20,S)+(2*(std(C,20)))-
mov(C,20,S)-(2*(std(C,20))))
68 Band Width (TASC) (mov(C,20,S)+(2*(std(C,20))))-(mov(C,20,S)-(2*(std(C,20))))/mov(C,20,S)
69 Volume % above/below 10 day MA (V-mov(V,10,S))/mov(V,10,S)
70 # of STD's of volume (V-mov(V,20,S))/std(V,20)
71 Morris' RSI w/volume (TASC) 100-(100/(1+(mov(if(roc(C,1,$),>,0,roc(C,1,$)*V,0),14,S)/
mov(if(roc(C,1,$), <,0,-roc(C,1,$)*V,0),14,S))))
72 Custom A/D Oscillator cum(if(C,>,ref(C,-2),1,if(C,<,ref(C,-2),-1,0)))
73 Empty Candlestick if(C,>,o{then empty},+1,0)
74 Filled Candlestick if(C,<,o{then filled},+1,0)
75 Doji if(C,=,o{then doji},+1,0)
76 Bearish engulfing lines if(fml(#28),=,+1,if(ref(fml(#27),-1),=,+1,if(C,<=,ref(O,-1),if(O,>=,
ref(C,-1),-1,0),0),0),0)
77 Bullish engulfing lines if(fml(#27),=,+1,if(ref(fml(#28),-1),=,+1,if(C,>=,ref(O,-1),if(O,<=,
ref(C,-1),+1,0),0),0),0)
78 Engulfing Line Binary wave fml(#30)+fml(#31)
79 Largest negative change in close llv(roc(C,1,$),40)
80 Choppiness Index (TASC) ((log(sum(atr(1),14)/(hhv(if(H,>=,ref(C,-1),H,ref(C,-1)),14)-llv(if(L,<=,
ref(C,-1),L,ref(C,-1)),14)))/log(10))/(log(14)/log(10)))*100

(Go Top)

Common Metastock Bar Patterns

BAR - 3 Higher Highs
H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3)

BAR - 3 Lower Lows & Reversal H
L>Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) AND
Ref(L,-3)<Ref(L,-4)

BAR - 3 Lower Lows
L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3)

BAR - 5 Lower Lows
L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) AND
Ref(L,-3)<Ref(L,-4) AND Ref(L,-4)<Ref(L,-5)

BAR - Expansion Buy
If(C > Ref(HHV(C,42),-1) AND H-L >= Ref(HHV((H-L),9),-1),1,0)

BAR - Expansion Sell
If(C < Ref(LLV(C,42),-1) AND (H-L) >= Ref(HHV((H-L),9),-1),1,0)

BAR - Fractal-down
If(LOW < Ref(LOW, -1),1,0) AND If(LOW < Ref(LOW, -2),1,0) AND If(LOW <
Ref(LOW,+1),1,0) AND If(LOW < Ref(LOW,+2),1,0)

BAR - Fractal-up
(If(HIGH > Ref(HIGH, -1),1,0) AND If(HIGH > Ref(HIGH, -2),1,0) AND If(HIGH
> Ref(HIGH, +1),1 ,0)AND If(HIGH > Ref(HIGH,+2),1,0))

BAR - Gap Down
GapDown()

BAR - Gap Up
GapUp()

BAR - H > Yesterday's H
H>Ref(H,-1)

BAR - Highest Bars Ago
HighestBars(CLOSE)

BAR - Highest High Value Bars Ago
HHVBars(CLOSE,50)

BAR - Inside Day + Day 3
Ref(Fml("BAR - Inside Day"),-3)

BAR - Inside Day
HIGH < Ref(HIGH,-1) AND LOW > Ref(LOW,-1)

BAR - Lizard Buy
If(O >= L + ((H-L) * .75) AND C >= L + ((H-L) * .75) AND L <
Ref(LLV(L,9),-1),1,0)

BAR - Lizard Sell
If(O <= L + ((H-L) * .25) AND C <= L + ((H-L) * .25) AND H >
Ref(HHV(H,9),-1),1,0)

BAR - Narrow Range 4
HIGH - LOW < Ref(LLV(H-L,3),-1)

BAR - Narrow Range 7
HIGH - LOW < Ref(LLV(H-L,6),-1)

BAR - O > Yesterday's C
O>Ref(C,-1)

BAR - Outside Day & > C
Outside() AND C>Ref(C,-1)

BAR - Outside Day
HIGH > Ref(HIGH,-1) AND LOW < Ref(LOW,-1)

BAR - Pivot Buy
If(H-L > Ref(HHV((H-L),9),-1) AND ((L <= Mov(C,50,S)) OR Ref(L,-1) <=
Ref(Mov(C,50,S),-1))
AND C > Mov(C,50,S),1,0)

BAR - Pivot Sell
If(H-L > Ref(HHV((H-L),9),-1) AND ((H >= Mov(C,50,S)) OR Ref(H,-1) >=
Ref(Mov(C,50,S),-1))
AND C < Mov(C,50,S),1,0)

BAR - Reaction Day with Volume
ReactionWithVol()

BAR - Reaction Day
Reaction()

BAR - Surprise Day Down
O<Ref(C,-1) AND C>O AND C<Ref(C,-1)

BAR - Surprise Day Up
O>Ref(C,-1) AND C<O AND C>Ref(C,-1)

BAR - Trough Value - 5
Trough(1,CLOSE,5)

BAR - Typical Price
Typical()

(Go Top)

Congestion Index

((HHV(C,80)-LLV(C,80))/LLV(C,80))*100

Consolidation breakout (upside)

If(Ref(Fml("congestion index"),-5),<,10, {and} If(Fml("congestion index"),>=,10, {and} If(CLOSE,>,Ref(HHV(C,80),-5), {and} If(Mov(V,5,S),>=,1.5*(Ref(Mov(V,60,S),-5)), +1,0),0),0),0)

Consolidation breakout (downside)

If(Ref(Fml("congestion index"),-5),<,10{%},{and} If(Fml("congestion index"),>=,10{%},

{and} If(CLOSE,<,Ref(LLV(C,80),-5),{and} If(Mov(V,5,S),>=,1.5*(Ref(Mov(V,60,S),-5)),+1,0),0),0),0)

(Go Top)

Connors & Raschke's Historical Volatility System

Here is the Connors and Raschke's historical volatility system exploration in August 1996 TASC Trader's Tips translated for MetaStock.

COLUMN FORMULAS

Column A : Vol ratio

std(log(C/ref(C,-1)),5)/std(log(C/ref(C,-1)),99)

Column B : NR4 day

if(HIGH-LOW,<,ref(llv(H-L,3),-1),1,0)

Column C : Inside

if(HIGH,<,ref(HIGH,-1),if(LOW,>,ref(LOW,-1),1,0),0)

Column D : High

HIGH

Column E : Low

LOW

FILTER FORMULA

Formula:

when(colA,<,0.5) AND (when(colB,=,1) OR when(colC,=,1))

(Go Top)

Consolidation Breakout, Downside

If(Ref(Fml("congestion index"),-5),<,10,

{and} If(Fml("congestion index"),>=,10,

{and} If(CLOSE,>,Ref(HHV(C,80),-5),

{and} If(Mov(V,5,S),>=,1.5*(Ref(Mov(V,60,S),-5)),

+1,0),0),0),0)


Stocks breaking out of consolidation (downside)

Col A: CLOSE

Filter: Fml("Consolidation breakout (downside)") = 1

Filter enabled: Yes

Here is the "consolidation breakout(downside)" formula:

If(Ref(Fml("congestion index"),-5),<,10{%},

{and} If(Fml("congestion index"),>=,10{%},

{and} If(CLOSE,<,Ref(LLV(C,80),-5),

{and} If(Mov(V,5,S),>=,1.5*(Ref(Mov(V,60,S),-5)),

+1,0),0),0),0)

(Go Top)

Consolidation Breakout, Upside

Col A: CLOSE

Filter: Fml("Consolidation breakout (upside)") = 1

Filter enabled: Yes

(Go Top)

Consolidation Over 16 Weeks

Col A: CLOSE

Filter Fml("congestion index") <= 10 AND BarsSince(Fml("congestion index")>10) > 0

Filter enabled Yes


Here is the "congestion index" formula:

((HHV(C,80)-LLV(C,80))/LLV(C,80))*100

(Go Top)

Countback line for Metastock

(Note. This is very good, but the limitation is the lookback period. The

calculation point for the CBL line might be 5, 10, 15, 30 days away from

todays date.Also watch for the way 'gap' days are treated. Daryl Guppy)

Copied from StockCentral - Thanks Ken D

Well .... last weekend I replied to a post requesting a MetaStock solution for calculating the Countback Line discussed in Daryl Guppy's book "Share Trading: An Approach to Buying and Selling". Subequently, about 30 requests for the formulas I use were received. Not unexpectedly, a few defects were found with the original offerings. This helped forge a somewhat more robust solution, which is here given to the wider audience of this Forum, so that further improvements may be forthcoming. Alternatives of presentation style are many, according to taste, but we are here requesting improvements in substance, identification of possible flaws, or have real simplification benefits - please provide solutions where possible.

ACKNOWLEDGEMENTS .... With thanks to the several people who have commented, all constructively it is pleasing to say, particular credit is warranted by the significant contributions from Bryan Stanton and Siobhan Channon.

LIMITATIONS .... With MetaStock, there seems to be a need for two different formulas to handle the issue: - one for the CBL from a LOW (CBLlo), - the other for the CBL from a HIGH (CBLhi). The formulas given below were generated using v.6.52. Because of the use of PREV they won't work in some earlier MetaStock versions it seems, though a bit of thought should overcome this limitation - anyone able to comment? As written they are based upon relative prices over a DEFAULT cover of 13 days (but adjustable from 3 to 55 days) - this is one of the potential weaknesses which commands individual interpretation for a particular equity or contract, which may cycle more or less frequently and require different timeframes. Other indicators and assessments are, of course, needed to gauge the probability of a CBL-indicated counter-trend holding. Also, for particularly choppy or indecisive circumstances there may be a need to extend the Ref(H or L, -5) to a greater number of comparison days by appropriate copying and adjustments to the basically simple pattern in these formulas - but if it came to this perhaps the trade should be left alone anyway! Owing to price vagaries it is not unusual for a CBLhi to be less than a CBLlo calculation, or the converse, especially with low-gradient trends or sideways price movements.

NOTE: With each formula below, copy exactly from "HighDays" or "LowDays" down to "PREV )))))" into the Indicator Builder.

CBLhi:

HighDays := Input("Enter # days to cover last HIGH for CBL calc'n:", 3, 55, 13);

If(HIGH < HHV(HIGH, HighDays), {then ...} PREV, {previous CBLhi, else...} If(Ref(L,-2) < Ref(L,-1) AND Ref(L,-2) < L AND Ref(L,-1) < L, {then ...} Ref(L,-2), {2nd day back low, else...} If((Ref(L,-3)< Ref(L,-2) AND Ref(L,-3) < Ref(L,-1) AND Ref(L,-3) < L) AND (Ref(L,-2)< L OR Ref(L,-1) < L), {then ... } Ref(L,-3), {3rd day back low, else...} If((Ref(L,-4)< Ref(L,-3) AND Ref(L,-4) < Ref(L,-2) AND Ref(L,-4) < Ref(L,-1) AND Ref(L,-4) < L) AND (Ref(L,-3)< L OR Ref(L,-2) < L OR Ref(L,-1) < L), {then... } Ref(L,-4), {4th day back low, else...} If((Ref(L,-5)< Ref(L,-4) AND Ref(L,-5) < Ref(L,-3) AND Ref(L,-5) < Ref(L,-2) AND Ref(L,-5) < Ref(L,-1) AND Ref(L,-5) < L) AND (Ref(L,-4)< L OR Ref(L,-3) < L OR Ref(L,-2) < L OR Ref(L,-1) < L), {then ...} Ref(L,-5), {5th day back low, else...} PREV )))))

and for the CBL from a LOW

CBLlo:

LowDays := Input("Enter # days to cover last LOW for CBL calc'n:", 3, 55, 13);

If(LOW > LLV(LOW, LowDays), {then ...} PREV, {previous CBLlo, else...} If(Ref(H,-2) > Ref(H,-1) AND Ref(H,-2) > H AND Ref(H,-1) > H, {then ...} Ref(H,-2), {2nd day back high,else...} If((Ref(H,-3)> Ref(H,-2) AND Ref(H,-3) > Ref(H,-1) AND Ref(H,-3) > H) AND (Ref(H,-2)> H OR Ref(H,-1) > H), {then ... } Ref(H,-3), {3rd day back high,else...} If((Ref(H,-4)> Ref(H,-3) AND Ref(H,-4) > Ref(H,-2) AND Ref(H,-4) > Ref(H,-1) AND Ref(H,-4) > H) AND (Ref(H,-3)> H OR Ref(H,-2) > H OR Ref(H,-1) > H), {then... } Ref(H,-4), {4th day back high,else...} If((Ref(H,-5)> Ref(H,-4) AND Ref(H,-5) > Ref(H,-3) AND Ref(H,-5) > Ref(H,-2) AND Ref(H,-5) > Ref(H,-1) AND Ref(H,-5) > H) AND (Ref(H,-4)> H OR Ref(H,-3) > H OR Ref(H,-2) > H OR Ref(H,-1) > H), {then ...} Ref(H,-5), {5th day back high,else...} PREV )))))

Please advise of any problems or suggested improvements in calculating the CBL. It is again emphasized that this is by no means proposed as the best solution, but as ONE solution which seems to work. Regards.

(Go Top)

Create a Gann Swing Expert

Instructions

1. First create a new expert and name it whatever you want.

2a. under "trends" tab put this code for bullish:

ut:=FmlVar("GANN-Trend","TDV");
uplot:=If(BarsSince(Ut=1)<
BarsSince(Ut=-1),1,0);
uplot=1;

2b. and this for bearish:

dt:=FmlVar("GANN-Trend","TDV");
dplot:=If(BarsSince(dt=1)>
BarsSince(dt=-1),1,0);
dplot=1;

Then click on the "ribbon" option and turn off "Display Vertical Lines", I also turn off the corner option.

3a. Under highlights tab create a new and call it "HiLo Change", choose color, and enter this code:

HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),
{then}1,
{else}If(CLOSE<Ref(Mov(L,3,S),
-1),
{then}-1,
{else}0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HLv<>Ref(HLv,-1);

3b. Create new and call it "Up-Trend", choose color, and enter this code:

ut:=FmlVar("GANN-Trend","TDV");
uplot:=If(BarsSince(Ut=1)<
BarsSince(Ut=-1),1,0);
uplot=1;

3c. Create new and call it "Down-Trend", choose color, and enter this code:

dt:=FmlVar("GANN-Trend","TDV");
dplot:=If(BarsSince(dt=1)>
BarsSince(dt=-1),1,0);
dplot=1;

4a. Under "Symbols" tab create new and call it " UpSwing", enter this code:

FmlVar("GANN-Swing","SD2")=1;

then under graphic choose "Buy Arrow", choose color (Dark Green), and small size, then pick "Above Price Plot".

4b. Create new and call it "DownSwing", enter this code:

FmlVar("GANN-Swing","SD2")=-1;

then under graphic choose "sell arrow", choose color (Dark Red), and small size, then pick "Below Price Plot".

As for the HiLo ....just plot it as a regular indicator and choose the last "style" option under "color/style" tab.

(Go Top)

Creating Dynamic Vertical Lines

from Ken

These are dynamic moving vertical lines. Each new bar causes the line to move orward one bar.
How to Create a Vertical Line in MetaStock

{Plot in Stoch window}
{...you can change the 100 and 0 to 80/20 or ?}
n:=Input("Bars Before LastLoadedBar", 0,1000,89);
LastLoadedBarNum:=LastValue(Cum(1));
If(Cum(1)=(LastLoadedBarNum-n)+1,100,0)
....or

Create a new Expert.
Place the following in "Trends"/"Bullish".

n:=89;
LastLoadedBarNum:=LastValue(Cum(1));
Cum(1)=(LastLoadedBarNum-n)+1

In "Corner", UNcheck "Display symbol in Expert corner".
In "Ribbon", check Display Ribbon, Display Vertical Line, and "Ribbon's inner window".
Delete or rename the "Neutral" label.
Choose Bullish color.

Plot Stochastic on chart, attach Expert, then drag Expert to Stochastic inner window

(Go Top)

Cross Above 200 MA on Twice Average Volume

Filter (C>Mov(C,200,S) AND Ref(C,-5)<Ref(Mov(C,200,S),-5)) AND C>5 AND V>Mov(V,200,S)*2

(Go Top)

Crossing Below 200 Day MA on Double Average Volume

Filter (C<Mov(C,200,S) AND Ref(C,-5)>Ref(Mov(C,200,S),-5)) AND C>5 AND V>Mov(V,200,S)*2

(Go Top)

Customisable StochRSI from Nicholas Kormanik

The formula I've adopted was put on the Silicon Investor web site thread by
'bdog'. Basically, I just leave the Slowing Periods (mp3) to 1, so it
really plays no part in things. However, if somebody presents a good
argument for using other than 1 ... hey, I'm amenable.

Chande, the original inventor, didn't use a moving average on the whole
thing. Chande's result was therefore sort of choppy. I guess along the way
people decided to add the EMA Periods to smooth things out.

Here's the MSWin formula:


mp1:=Input("RSI Periods",1,377,13);
mp2:=Input("Stoch Periods",1,377,13);
mp3:=Input("Slowing Periods",1,377,1);
mp4:=Input("EMA Periods",1,377,5);

Mov(Sum((RSI(mp1)-LLV(RSI(mp1),mp2)),mp3)/Sum((.0000001+(HHV(RSI(mp1),mp2)-(
LLV(RSI(mp1),mp2)))),mp3),mp4,E)*100


Now, from various posts, etc., the following parameters (mp1, mp2 and mp4)
*seem* to be the one's recommended. I'm trying to further find consensus
among users of StochRSI on what really appears to work for them.


StochRSI Set
--------------------
5 -- 5 -- 3
8 -- 8 -- 5
13 -- 13 -- 13
21 -- 15 -- 13
21 -- 21 -- 13
34 -- 34 -- 13
55 -- 55 -- 21
89 -- 13 -- 34
89 -- 89 -- 21
233 -- 233 -- 34

(Go Top)

Cyclical System

from Ton Maas ms-irb@wxs.nl

"Trading Stocks With A Cyclical System" by Jeffrey Owen Katz (TASC-Feb1999).
(Translated for MetaStock 6.5 by Ton Maas -The Netherlands - June1999).
----------------------------------------------------------------------------
(The system's original Easy Language formulas+system were derived from
theabove mentioned TASC article). My guess is that Equis (Alan McNichol) was
not in the possession of them when he wrote the Equis version of the system,
back in the Feb99 Trader's Tips section of TASC).

-----------------------
MetaStock 6.5 Indicator
-----------------------
Name:
Cyclical System - J O Katz

Formula:
{TASC Feb99}
thresh:= {omit whipsaw} 4;
k:= {roc comparison period} 3;
m:= {cycle period} 63;
hld:= {maximum period holding position} 10;
Value1:= {volatility}
Stdev(Mov(C,m,S)-Mov(C,m+k,S),20);
Value2:= {roc, relative comparison ratio}
Mov(C,m,S)-Mov(C,m+k,S);
tv1:= thresh*Value1;
EL:={Enter Long} Value2>tv1;
CL:={Close Long} Ref(Cross(Value2,tv1),-hld);
ES:={Enter Short} Value2<tv1;
CS:={Close Short} Ref(Cross(tv1,Value2),-hld);
JKcycl:=If((EL>0)=1,+10,
If((ES>0)=1,-10,0));
JKcycl

---------------------------
MetaStock 6.5 System Tester
---------------------------
Name:
Jeffrey Owen Katz - Cyclical System
Notes:
{February 1999 - TASC-article (see also TRADERS' TIPS)}

Formulas:
{copy-repeat all that is printed below when applying for the right rule}
thresh:= {omit whipsaw} 4;
k:= {roc comparison period} 3;
m:= {cycle period} 63;
hld:= {maximum period holding position} 10;
Value1:= {volatility}
Stdev(Mov(C,m,S)-Mov(C,m+k,S),20);
Value2:= {roc, relative comparison ratio}
Mov(C,m,S)-Mov(C,m+k,S);
tv1:= thresh*Value1;

Rules:
{Enter Long} Value2>tv1
{Close Long} Ref(Cross(Value2,tv1),-hld)
{Enter Short} Value2<tv1
{Close Short} Ref(Cross(tv1,Value2),-hld)

{After entering the formulas, click OK. Then click Options. On the Testing
page, set the Trade Delay to zero, set Positions to "both", and then set any
other desired options (apart from Optimizing, which is not advisable; leave
the factory default settings). Click OK to save the changes, and then open a
chart and run the system.}

(Go Top)

Candle Strength Index

Periods:=Input("Enter Periods",2,13,2);
Mov(Mov(Mov(Fml("Candlecode"),Periods,S),Periods,S),Periods,S)

(Go Top)

Chande Momentum Oscillator Composite Average

(((CMO(C,5))+(CMO(C,10))+(CMO(C,20)))/3)

(Go Top)

Chande Momentum Oscillator Volatility

S1:= Stdev( CMO(C,5),5);
S2:= Stdev(CMO(C,10),10);
S3:= Stdev(CMO(C,20),20);
CMOV:=(S1*CMO(C,5))+(S2*CMO(C,10))+(S3*CMO(C,20))/(S1+S2+S3);
CMOV;

(Go Top)

Chande's Momentum Oscillator

The following are MetaStock formulas for Tuschar Chande's Momentum Oscillator. For interpretation refer to the book The New Technical Trader, by Tuschar Chande and Stanley Kroll.

CMO_1
Sum( If( C ,> ,Ref( C, -1 ) , ( C - Ref( C ,-1 ) ) ,0 ) ,14 )

CMO_2
Sum( If( C ,< ,Ref( C ,-1 ) , ( Ref( C ,-1 ) - C ) ) ,0 ) ,14 )

CMO_Final
100 * ( ( Fml( "CMO_1" ) - Fml( "CMO_2" ) ) / ( Fml( "CMO_1" ) + Fml( "CMO_2" ) ) )

You could also combine the above three formulas into one formula. The syntax would be:

100*((Sum(If(C,>,Ref(C,-1),(C-Ref(C,-1)),0),14))-(Sum(If(C,<,REF(C,-1),(REF(C,-1)-C),0),14))) /((Sum(If(C,>,Ref(C,-1),(C-Ref(C,-1)),0),14)+(Sum(If(C,<,REF(C,-1),(REF(C,-1)-C),0),14))))

*** These formulas were constructed using 14 time periods, you can change this by replacing every occurrence of 14 with your desired time period value.

(Go Top)

Chande's Trendscore

If(C>=Ref(C,-11),1,-1)+If(C>=Ref(C,-12),1,-1)+If(C>=Ref(C,-13),1,-1)+
If(C>=Ref(C,-14),1,-1)+If(C>=Ref(C,-15),1,-1)+If(C>=Ref(C,-16),1,-1)+
If(C>=Ref(C,-17),1,-1)+If(C>=Ref(C,-18),1,-1)+If(C>=Ref(C,-19),1,-1)+
If(C>=Ref(C,-20),1,-1)

(Go Top)

Comparitive Relative Strength in MetaStock™ for Windows

Comparative Relative Strength charts can be useful in deciding which security to buy, by helping to pinpoint the best performer. They can also be useful in developing spreads, i.e., purchase of the best performer "long", and selling the weaker issues "short." Comparative Relative Strength can be applied in MetaStock for Windows as follows:

Creation of a Template for Comparative Relative Strength

(For this illustration, we assume an equity/stock is compared to the S&P 500, both of which must first have been collected from your vendor. Both data files should be in the same periodicity.)

  1. Load the S&P 500.

  2. Load the equity, or whatever you wish to find the relative strength for.

  3. Drag the S&P 500 plot into a new inner window of the equity. (You may need to click Stack first.)

  4. Close the S&P 500 chart.

  5. Create a custom indicator: Div(close, p)

  6. Drag the custom indicator into the inner window containing the S&P 500 plot, moving it over the plot until the plot changes to a pink or lavender color, then release your mouse button. (This is called dragging and dropping an indicator on an indicator. The new indicator will plot in the same window as the S&P 500 plot.) You have two options here:

    • You can change the color of the S&P 500 plot to be the same as the chart background color, so that it is effectively invisible. (Double-click the S&P 500 plot to get to its "properties", then choose the color you need from the Colors list.)

    • You can give both plots different colors so you can tell which is which.

  7. Save this chart as a Template. (File|Save As, set "Save File As Type" to Template, and give it a name, such as CMPRELST.MWT.)

Any time you want to see Comparative Relative Strength of an equity against the S&P 500, apply this template to the equity's chart. Note: if you should move the data file against which you are comparing, such as the S&P 500, this template will no longer work, and would have to be recreated.

To Run an Exploration Using Comparative Relative Strength

  1. Load the S&P 500 (or whatever you want to compare against).

  2. Create a custom indicator of the Close.

  3. Drag and drop this indicator on the S&P 500 (or whatever...). (Note: the S&P 500 plot must change to pink/lavender color before you drop it.) The indicator will plot.

  4. Select the indicator plot (by single-clicking with the left mouse button on the line).

  5. Do an Exploration with DIV(Close,p) in column A, and specify which directory to explore.

  6. The results are displayed in the Exploration report.

(P is a special variable that points at the last indicator plotted or selected.)

(Go Top)

Confidence %

(Sum(Mov(C * (2.5/ Sqrt(50 * V)),10,S)-
LLV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5), 3 ) /
Sum(HHV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5) -
LLV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5), 3) ) * 100

(Go Top)

Coppock Curve

The Coppock Curve was developed by Edwin Sedgwick Coppock in 1962. It was featured in the November 94 issue of Technical Analysis of Stocks & Commodities, in the article "The Coppock Curve", written by Elliot Middleton.:

Taken from Stocks & Commodities, V. 12:11 (459-462): The Coppock Curve by Elliott Middleton

"We are creatures of habit. We judge the world relative to what we have experienced. If we're shopping for a mortgage and rates have been in the teens (as they were in the early 1980s) and then drop to 10%, we are elated. If, however, they've been at 8% and then rise to 10%, we are disappointed. It all depends on your perspective.

The principle of adaptation-level applies to how we judge our income levels, stock prices and virtually every other variable in our lives. Psychologically, relativity prevails..

SIMPLEST FORMS

The moving average is the simplest form of adaptation-level. Moving average crossover rules accurately signal the onset of periods of returns outside the norm, whether positive or negative. This makes moving average crossovers useful to traders who want to get a boost on entering or exiting stocks or funds.

The oscillator is also based on adaptation-level, although in a slightly different way. Oscillators generally begin by calculating a percentage change of current price from some previous price, where the previous price is the adaptation-level or reference point. The mind is attuned to percentage changes because they represent returns. If you bought Microsoft Corp. stock (MSFT) at $50 and it goes to $80, you make 60% before dividends. If you bought Berkshire Hathaway (BRK) at $4,000 and it rises to $4,030, the same dollar gain, you make 0.75% before dividends. It's the percentage change that counts. Relativity again.

Coppock reasoned that the market's emotional state could be determined by adding up the percentage changes over the recent past to get a sense of the market's momentum  (and oscillators are generally momentum indicators ). So if we compare prices relative to a year ago - which happens to be the most common interval - and we see that this month the market is up 15% over a year ago, last month it was up 12.5% over a year ago, and 10%, 7.5% and 5%, respectively, the months before that, then we may judge that the market is gaining momentum and, like a trader watching for the upward crossover of the moving average, we may jump into the market."

The MetaStock™ formula for the Coppock Curve is:

(MOV(ROC(MOV(C,22,S),250,%),150,E))/100

(Go Top)