Thursday, September 14, 2006

3 Minute Bar Breakout

{Functions used in Middle Screen}
MiddleScreenBlue := Mov( Close, 34, E )
MiddleScreenYell := Mov( Open, 13, E )
{Functions used in Lower Screen}
StochRed := Stoch( 9, 7 )
StochLagging : = Mov( StochRed, 7, S )

{ Main analysis section }
{BULLISH}
Cross( StochRed, StochLagging ) AND ( MiddleScreenYell > MiddleScreenBlue )

{BEARISH}
Cross( StochLagging, StochRed ) AND ( MiddleScreenYell < MiddleScreenBlue )

{ Breakout Notifier }
UpperSupportNow := Mov( OPEN, 10, E )
LowerSupportNow := Mov( CLOSE, 8, E )
PrevUpperSupport := Ref( Mov( OPEN, 10, E ), -1 )
PrevLowerSupportNow := ref( Mov( CLOSE, 8, E ), - 1 )
TRUE := 1
FALSE := 0
SignalledHigh := FALSE
SignalledLow :=FALSE

{ BULLISH }
IF ( ( L > UpperSupportNow ) AND ( Ref( L, -1 ) > PrevUpperSupport ) AND
SignalledHigh = FALSE )
THEN
SignalledHigh := TRUE
IF ( SignalledHigh = TRUE )
THEN
SignalledLow :=FALSE

{BEARISH}
IF ( ( H < LowerSupportNow ) AND ( Ref( H, -1 ) > PrevLowerSupport ) AND
SignalledLow = FALSE )
THEN
SignalledLow := TRUE
IF ( SignalledLow = TRUE )
THEN
SignalledHigh := FALSE


Sunday, July 09, 2006

Metastock Formula : 2 Day Hammer Exploration

2 Day Hammer Exploration

Here is an exploration that pattern traders may find useful. It tends to pick up two patterns: a two day hammer, that is if you combined the open for day 1 and close for day 2, the resulting bar would be a hammer, and a pattern similar to a Ross Hook, as I understand a Ross Hook.

Ref((C-L)/(H-L),-1)<=.30 AND ((C-L)/(H-L)) >= .70 AND

Ref(ATR(1),-1) >ATR(10) AND

ATR(1) >= ATR(10)

Metastock Formula : Double Tops & Bottoms

Double Tops and Double Bottoms
In the February 1998 issue of Technical Analysis of Stocks & Commodities magazine, Thomas Bulkowski discusses the use of Double Bottoms as a means of finding profitable trades.
In MetaStock for Windows, you can find both Double Tops and Double Bottoms with these formulas. There is a caveat however. In the article, Mr. Bulkowski utilizes the High-Low range in finding Double Bottoms. These formulas use only the close value, so a few of the lower priced issues will not produce signals in MetaStock. Overall, however, these formulas produce most of the major signals he discusses.

Double Tops

PK:=Zig(C,10,%)Ref(Zig(C,10,%),-2);
TR:=Zig(C,10,%)>Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)PK1:=PeakBars(1,C,10);
PK2:=PeakBars(2,C,10);
(ValueWhen(1,PK,Ref(C,-1))/ValueWhen(2,PK,Ref(C,-1))>.96 AND ValueWhen(1,PK,Ref(C,-1)) / ValueWhen(2,PK,Ref(C,-1))<1.04)>=10 AND Cross(ValueWhen(1,TR,Ref(C,-1)),C)

Double Bottoms

PK:=Zig(C,10,%)Ref(Zig(C,10,%),-2);
TR:=Zig(C,10,%)>Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)TR1:=TroughBars(1,C,10);
TR2:=TroughBars(2,C,10);
(ValueWhen(1,TR,Ref(C,-1))/ValueWhen(2,TR,Ref(C,-1))>.96 AND ValueWhen(1,TR,Ref(C,-1)) / ValueWhen(2,TR,Ref(C,-1))<1.04)>=10 AND Cross(C,ValueWhen(1,PK,Ref(C,-1)))

Metastock Formula : High Volume

High Volume
Displays those where volume is above the 100 day moving average.
The search returns 1 for Ok and 0 for not ok.
· VOLUME
· Mov(VOLUME,100,EXPONENTIAL)
· ((VOLUME - Mov(VOLUME,100,EXPONENTIAL))
· /Mov(VOLUME,100,EXPONENTIAL)) * 100
· When(colA,>,colB)

Metastock Formula : MACD Crossover Buy Signal

MACD Crossover Buy Signal
Shows those stocks where an MACD crossover has been signalled.The search returns 1 for Ok and 0 for not ok.
· CLOSE
· MACD()
· Ref(MACD(),-1)
· Mov(MACD(),9,EXPONENTIAL)
· Ref(Mov(MACD(),9,EXPONENTIAL),-1)
· ((MACD() - Mov(MACD(),9,EXPONENTIAL)) /Mov(MACD(),9,EXPONENTIAL)) * 100
· **Cross( MACD(), Mov(MACD(),9,EXPONENTIAL))

Metastock Formula : MA Crossover - Bullish

Moving Average Crossover---Bullish
This is a10 and 30 day moving average crossover search. Results close to 0 pinpoint the crossover.
· CLOSE
· Mov(CLOSE,30,EXPONENTIAL)
· ((CLOSE-Mov(CLOSE,30,EXPONENTIAL)) /Mov(CLOSE,30,EXPONENTIAL)) * 100
· ((CLOSE-Mov(CLOSE,10,EXPONENTIAL)) /Mov(CLOSE,10,EXPONENTIAL)) * 100
· **When(colA > colB)

Metastock Formula : Bottom Reversal

Bottom Reversal
These are a collection of bottom signals. The search returns 1 for Ok and 0 for not ok.
· CLOSE
· EngulfingBull()
· MorningDojiStar()
· MorningStar()
· WhiteSoldiers()

Metastock Formula : Price and Volume Breakout

Price and Volume Breakout
Shows stocks where the price increased 5% and the volume is 50% above a 50-day moving average. Rank results by % change in price, then check the volume.
· CLOSE
· Ref(CLOSE,-1)
· ROC(CLOSE,1,percent)
· VOLUME
· Mov(VOLUME,50,EXPONENTIAL)
· ((VOLUME - Mov(VOLUME,50,EXPONENTIAL)) /Mov(VOLUME,50,EXPONENTIAL)) * 100
· **When(colC >= 5) AND When(colD >= colE*1.5)

Metastock Formula: Elliott Wave Oscillator

Mov((H+L)/2,5,S)-Mov((H+L)/2,34,S)

Metastock Formulas: GAP UP

Gap Up Formulas

The MetaStock formulas to calculate these percentages are shown below. The
first input is the minimum gap (e.g., 1%), and the second input is the gap
increment (e.g., 1%, which would give you a range of 1-2%). To calculate
gaps down, change the percentage to a negative.

Formula to determine whether the closing price is equal to or exceeds the
opening price on a gap day:

MinGap := Input("Minimum gap to consider (%)",-10000,10000,1);
GapIncrement := Input("Gap Increment (%)",0,100,1);

LookingForGapUp := MinGap >= 0; LookingForGapDown := MinGap < 0;

{ Gap percentage }
Gap := (OPEN - Ref(CLOSE,-1))/Ref(CLOSE,-1)*100;

NumGaps := If(LookingForGapUp, Cum(Gap >= MinGap AND Gap < MinGap +
GapIncrement), If(LookingForGapDown, Cum(Gap <= MinGap AND Gap > MinGap -
GapIncrement),0));

If(LookingForGapUp, Cum(If(Gap >= MinGap AND Gap < MinGap + GapIncrement,
If(CLOSE >= OPEN, +1,0),0)),

If(LookingForGapDown, Cum(If(Gap <= MinGap AND Gap > MinGap - GapIncrement,
If(CLOSE <= OPEN, +1, 0),0)), 0))/NumGaps*100;

Formula to determine whether the daily range crosses the previous day’s
close on a gap day:

MinGap := Input("Minimum gap to consider (%)",-10000,10000,1);
GapIncrement := Input("Gap Increment (%)",0,100,1);

LookingForGapUp := MinGap >= 0; LookingForGapDown := MinGap < 0;

{ Gap percentage }
Gap := (OPEN - Ref(CLOSE,-1))/Ref(CLOSE,-1)*100;

NumGaps := If(LookingForGapUp, Cum(Gap >= MinGap AND Gap < MinGap +
GapIncrement), If(LookingForGapDown, Cum(Gap <= MinGap AND Gap > MinGap -
GapIncrement),0));

If(LookingForGapUp, Cum(If(Gap >= MinGap AND Gap < MinGap + GapIncrement,
If(LOW <= Ref(CLOSE,-1), +1,0),0)),

If(LookingForGapDown, Cum(If(Gap <= MinGap AND Gap > MinGap - GapIncrement,
If(HIGH >= Ref(CLOSE,-1), +1, 0),0)), 0))/NumGaps*100;

Formula to determine whether the following day’s open continues the gap
trend:

MinGap := Input("Minimum gap to consider (%)",-10000,10000,1);
GapIncrement := Input("Gap Increment (%)",0,100,1);

LookingForGapUp := MinGap >= 0; LookingForGapDown := MinGap < 0;

GapYesterday := (Ref(OPEN,-1) - Ref(CLOSE,-2))/Ref(CLOSE,-2)*100;

NumGapsthruYesterday := If(LookingForGapUp, Cum(GapYesterday >= MinGap AND
GapYesterday < MinGap + GapIncrement), If(LookingForGapDown,
Cum(GapYesterday <= MinGap AND GapYesterday > MinGap - GapIncrement),0));

If(LookingForGapUp, Cum(If(GapYesterday >= MinGap AND GapYesterday < MinGap
+ GapIncrement, If(OPEN > Ref(CLOSE,-1), +1,0),0)),

If(LookingForGapDown, Cum(If(GapYesterday <= MinGap AND GapYesterday >
MinGap - GapIncrement, If(OPEN < Ref(CLOSE,-1), +1, 0),0)),
0))/NumGapsthruYesterday*100;

Metastock Formulas: BAR PATTERNS

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,-3)
BAR - 3 Lower Lows
L
BAR - 5 Lower Lows
LRef(L,-3)
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
OO AND C
BAR - Surprise Day Up
O>Ref(C,-1) AND CRef(C,-1)

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

BAR - Typical Price
Typical()

Metastock Formulas: Candle Shadow Support

These formulas have been picked up from various sources:

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(OPENOPEN,(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).

Saturday, July 08, 2006

Converting ASCII data to Metastock format

Convert the data into MetaStock format using Downloader by selecting ‘Convert’ from the ‘Tools’ menu:

Select the Source and Destination Folders:

If you click on the Options button, you should see the following screen:

The Destination tab should look like this (please ensure that the ‘Traverse destination folders checkbox is checked):

If you click on ‘OK’, you will be returned to the ‘Convert Securities’ form:


When you click on ‘OK’, your ASCII data will be converted into MetaStock format.

WELCOME

I would like to introduce myself as a Data ventor for the Historical database in Metastock as well as EOD's for the Indian Stock Markets.

Data Available for BSE, NSE as well as Futures segment!!!!!!!!

PLease contact me at metastockeod@gmail.com