Darvas Box Formula for METASTOCK


TRENDLINE.DLL
THIS PLUGIN PLOTS AVAILABLE TRENDLINES ONLY FOR LASTVALUE OF DATA
THEY CAN BE USED FOR EXPLORATION
NOT FOR BACKTESTING
The Plugin takes four parameters
scTrendLine(endval,startval,endbar,startbar);
EndBar is the oldest barssince
StartBar is the recent barssince
Endval is the array value of the endbar
Startval is the array value of the startbar
EXAMPLE
Plot(Close,"",1,64);
start= HHVBars(H,20);
end= HHVBars(H,100);
LineSup =scTrendLine(H,H,end,start);
Plot( LineSup ,"",5,1);
start= LLVBars(L,20);
end= LLVBars(L,100);
LineInf=scTrendLine(L,L,end,start);
Plot( LineInf ,"",4,1);
EXAMPLE EXPLORATION TO FIND TRIANGLES
Plot(Close,"",1,64);
start= (PeakBars(H,7,1));
end= (PeakBars(H,7,2));
LineSup =scTrendLine(H,H,end,start);
Plot( LineSup ,"",5,1);
start= (TroughBars(L,7,1));
end= (TroughBars(L,7,2));
LineInf=scTrendLine(L,L,end,start);
Plot( LineInf ,"",4,1);
Filter = (LineSup-Ref(Linesup,-1)) <= 0 AND
(Lineinf-Ref(Lineinf,-1)) >= 0
AND LineSup>LineInf;
AddColumn(IIf(C>LineInf AND CAddColumn(IIf(CLineSup,1,0),"Breakout");
EXAMPLE EXPLORATION TO FIND DIVERGENCE
You can use the scTrendLine(endval,startval,endbar,startbar);
with any indicator and try to find divergence with the close
start= LLVBars(L,20);
end= LLVBars(L,100);
LineInf =scTrendLine(L,L,end,start);
I=OBV();
start= LLVBars(I,20);
end= LLVBars(I,100);
LineI =scTrendLine(I,I,end,start);
Filter = (LineI-Ref(LineI,-1)) > 0 AND
(Lineinf-Ref(Lineinf,-1)) <= 0;
AddColumn(IIf(C>LineInf,1,0),"Divergence");
ZIGZAG on HIGH LOW
these dll plot a zigzag line on HIGH LOW based on a percentage or points changes
this zigzag does not look in the future only for the last bars, so the zigzag line is not
drawn until the correct % ( or points) is reached
the dll takes one parameter, the value of change
the zigzag line is based on a percentage, for example 4 for 4% change
or the zigzag line is based on a point change , for example 3* ATR(3)
for percentage change the dll is called scZigHiLo(percentage change)
for points change the dll is called scZigHiLoP(point change)
EXAMPLE
Plot( scZigHiLo(7) ,"",colorBlue,1); // 7 % of change
Plot(Close,"",1,64);
Plot(scZigHiLoP(3*ATR(3)),"",colorBlue,1); // 3*atr(3) of change
Plot(Close,"",1,64);
DARVASBOX
First thanks to Jonf who has written the js code for the Darvas Box.
The plugin is Darvas(); it takes no parameters.
A better explanation of the construction of the Darvas Box is available at:
1)
2)
A dll must return one statement , in the case of the darvas.dll, the function
Darvas() alone returns the stateArray
but you can also extract other statements from the dll
For example at the end of the source code of darvas.dll there are
gSite.SetVariable( "BotArray", BotArray );
gSite.SetVariable( "TopArray", TopArray );
gSite.SetVariable( "DBuy", DBuy );
gSite.SetVariable( "DSell", DSell );
gSite.SetVariable( "BoxArr1", BoxArr1 );
gSite.SetVariable( "BoxArr2", BoxArr2 );
gSite.SetVariable( "StateArray", StateArray );
return StateArray;
All of these statements can be given by the plugin.
You can visualize the box with the following code.
D=Darvas();
Plot(C,"",1,64);
Plot(Boxarr1,"",D,512);
Plot(Boxarr2,"",D,512);
Plot(dbuy*C,"",5,2);
Plot(dsell*C,"",4,2);
Title= "Darvas dll";
Note that a box is valid when the state is 5. The color allows you to see the valid box .
The Botarray and Toparray are the valid Bot and Top
Dsell and Dbuy are the signals when a Low is below the BotArray or a High above the TopArray
Darvas forms "boxes" based on his studies of price actions.
1) Step1=If PriceHigh stops making new highs for 3 days, make the PriceHigh 3 days ago the BoxTop and
go to Step 2.
2) Step2= If PriceHigh breaks BoxTop, go back to Step 1. Otherwise, If PriceLow stops making new lows
for 3 days then Make the PriceLow the BoxBottom and go to Step 3.
3) Step3=Now that the BoxTop and BoxBottom are formed, we have a Darvas Box. The Darvas Box is
broken when today s PriceHigh or PriceLow breaks BoxTop or BoxBottom.
The Darvas Box is based on 5 States and 3 steps to form the box
There is a plugin that allow us to change the number of steps and that gives us the possibility to
add a tick for the Breakout of High above TopArray OR Low below the BotArray
The name is DarvasT( ); the default value gives the Darvas( );
These default values are DarvasT(3,0);
You can modify them
For example:
D=DarvasT(4,0.01);
Plot(&,"",1,64);
Plot(Boxarr1,"",D,512);
Plot(Boxarr2,"",D,512);
Plot(dbuy*&,"",5,2);
Plot(dsell*&,"",4,2);
7LWOH= "Darvas dll";
2. Inverse DARVASBOX
Note the Darvas Box may be used to take a LONG position;
also in the plugin there is an Inverse Darvas Box for SHORT positions
You can visualize it with:
D=InvDarvas();
Plot(C,"",1,64);
Plot(Boxarr1,"",D,512);
Plot(Boxarr2,"",D,512);
Plot(dshort*C,"",5,2);
Plot(dcover*C,"",4,2);
Title= "Inv Darvas dll";
Dsell and Dbuy are the signals when a Low is below the BotArray or a High above the TopArray
3. DARVASBOX on ARRAY
you can also built any DarvasBox on Any indicators with the plugin DarvasA(Array);
for example on the AccDist().
Plot(AccDist(),"",1,1);
D=DarvasA( AccDist() );
Plot(Boxarr1,"",D,512);
Plot(Boxarr2,"",D,512);
Plot(dbuy*C,"",5,2);
Plot(dsell*C,"",4,2);
Title= "Darvas dll";
An other example with CLOSE +++
Plot(Close,"",1,64);
D=DarvasA(C);
Plot(Boxarr1,"",D,512);
Plot(Boxarr2,"",D,512);
Plot(dbuy*C,"",5,2);
Plot(dsell*C,"",4,2);
Title= "Darvas dll";
And if you want you can add one parameter at Darvas Array
it is the tick to get a Breakout (BO default is zero)
for example
Plot(Close,"",1,64);
D=DarvasA(C,0.01); means that you need a BO of 1% above or below the box to get a buy or sell signal
Dsell and Dbuy are the signals when a CLOSE is below the BotArray or a CLOSE above the TopArray
The same thing is possible with Inverse Darvas BOX
Example
D=InvDarvasA(C,0.01);
Plot(C,"",1,64);
Plot(Boxarr1,"",D,512);
Plot(Boxarr2,"",D,512);
Plot(dshort*C,"",colorRed,2);
Plot(dcover*C,"",colorGreen,2);
Title= "Darvas dll";


Wyszukiwarka

Podobne podstrony:
Formula for Success
Jim Rohn The Formula For Failure And Success
metastock breakout formulas
Metastock Formulas D 1
Metastock Formulas L
Metastock Formulas K
Metastock Formulas O
Metastock Formulas F
Metastock Formulas T
Metastock Formulas S 1
Metastock Formulas D
Metastock Formulas N
Metastock Formulas M 1
Metastock Breakout Formulas
Metastock Formulas S

więcej podobnych podstron