BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Darvas Volume Visualiser
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Darvas Volume Visualiser

 Post Reply Post Reply
Author
Message Reverse Sort Order / View First Unread Post
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Topic: Darvas Volume Visualiser
    Posted: 10 Jan 2010 at 6:23pm
Indicator Update.
 
1. Corrected the bar numbering
2. Added Parabolic SAR option
 

[Description="Darvas Works, Max"]

[target=price; linestyle=solid]

bo:=Input("Breakout Period",30,3);

cp:=Input("Confirmation Periods",3,3);

cper:=cp+1;

hvp:=Input("Largest volume spike in period: 0=off",15,0);

VolSize:=Input("Volume requirement%",0,0);

Flag:=input("Take Profit Band: 1=on",0,0,1);

[color=coral]

if(flag,ma(H,10,E) + 2.5*ATR(10),undefined);

average:=Input("Average Period: >0=on",30,0);

[color=lawn green]

if(average>0,ma(C,average,E),undefined);

CountHi:=if(H>=ref(HHV(H,bo),-1) and H>=ref(HHV(H,cper),-1),1,Prev+1);

[color=Blue; linestyle=solid]

[linestyle=Text; textalign=Above,Center;]

BoxTop:=If(CountHi<=cper and ref(CountHi,1)>2, Right(CountHi-1,2), undefined);

BoxTop;

High;

CountLo:=if(H>=ref(HHV(H,bo),-1) or L<ref(LLV(L,cper-1),-1) or CountHi<=2,1,Prev+1);

[color=red]

[linestyle=Text; textalign=Below,Center;]

If(CountLo<=cper and ref(CountLo+1,1)=2 and ref(CountLo,2)=3 and hist(barssince(BoxTop),1)<20

or CountLo<=cper and ref(CountLo,1)>2 and hist(barssince(BoxTop),1)<20

, Right(CountLo-1,2), undefined);

Low;

hvm:=if(hvp=0,15,hvp);

hv:=HHV(((V-ref(V,-1))/ref(V,-1))*100,hvm);

[color=Medium Orchid]

[linestyle=Text; textalign=Below,Center]

If(hvp and CountLo=cp and hist(barssince(BoxTop),1)<20

, round(hv,0) + "%", undefined);

Low*.97;

psar:=Input("Parabolic SAR: >0=on",0,0);

[linestyle=Points; color=Royal Blue]

if(psar,sar(0.01,0.05),undefined);

{ Darvas box rendering }

volOk := if(ref(hv,2*cp)>=Volsize,1,0);

breakoutOk := if(H>=ref(HHV(H,bo),-1),1,0);

firstBoxOk := breakoutOk and volOk;

normalBoxOk := breakoutOk;

dvRes := __Darvas(cp,cp,2,firstBoxOk,firstBoxOk);

TopBox := __DarvasTop(dvRes);

BottomBox := __DarvasBot(dvRes);

BoxNumber := __DarvasBoxNumber(dvRes);

inBox := BoxNumber >= 1;

startOfBox := BoxNumber > hist(BoxNumber,1);

endOfBox := (startOfBox and BoxNumber > 1) or (BoxNumber = 0 and hist(BoxNumber,1)>0);

[drawundefined=gap]

[name=Top Darvas; color=dodger blue; linestyle=HorzStep; target=Price]

TopBox;

[name=Bottom Darvas; color=dodger blue; linestyle=HorzStep]

BottomBox;

[name=Right Darvas Vertical; color=dodger blue; linestyle="Fill Bars"]

if(endOfBox,hist(TopBox,1),undefined);

if(endOfBox,hist(BottomBox,1),undefined);

[name=Left Darvas Vertical; color=dodger blue; linestyle="Fill Bars"]

if(startOfBox,TopBox,undefined);

if(startOfBox,BottomBox,undefined);



Edited by maximo - 10 Jan 2010 at 6:31pm
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 07 Nov 2009 at 5:52pm

added a moving average for alternate or remaining exit.

 insert code after line 6:
 
average:=Input("Average Period: >0=on",30,0);

[color=lawn green]

if(average>0,ma(C,average,E),undefined);



Edited by maximo - 08 Nov 2009 at 12:35am
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 07 Nov 2009 at 5:32pm
I added a parcel split/take profit band.  The idea being to close half the position at, or above this band. 
insert code after line 6:
 
Flag:=input("Take Profit Band: 1=On",0,0,1);
[color=coral]
if(flag,ma(H,10,E) + 2.5*ATR(10),undefined);
 


Edited by maximo - 08 Nov 2009 at 12:34am
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 26 Oct 2009 at 3:34am

gazillions you say?  I would need a half gazillion to make that much lol.  Doing alright though trading futures and forex more than stocks.

I've been trying to develop the logic to detect Ascending triangles in a scan for quite some time.  It turns out a variation of darvas logic may be the answer to detecting them effectively.   As Darvas is a higher low, one within another one would be 2 consective higher lows or side by side.   So began the exercise of uncovering the logic.   
 
Here's a Darvas box confirmation counter I developed over the weekend.   The idea behind this is
when the High & Low counts = confirm count then a box is formed.
 
 

[Description="Darvas Works, Max"]

[target=price; linestyle=solid]

bo:=Input("Breakout Period",30,3);

cp:=Input("Confirmation Periods",3,3);

hvp:=Input("Largest volume spike in period: 0=off",15,0);

VolSize:=Input("Volume requirement%",0,0);

CountHi:=if(H>=ref(HHV(H,bo),-1) and H>=ref(HHV(H,cp),-1),1,Prev+1);

[color=Blue; linestyle=solid]

[linestyle=Text; textalign=Above,Center;]

BoxTop:=If(CountHi<=cp and ref(CountHi,1)>1, Right(CountHi,2), undefined);

BoxTop;

High;

CountLo:=if(H>=ref(HHV(H,bo),-1) or L<ref(LLV(L,cp-1),-1) or CountHi<=2,1,Prev+1);

[color=red]

[linestyle=Text; textalign=Below,Center;]

If(CountLo<=cp and ref(CountLo,1)=2 and ref(CountLo,2)=3 and hist(barssince(BoxTop),1)<20

or CountLo<=cp and ref(CountLo,1)>2 and hist(barssince(BoxTop),1)<20

, Right(CountLo,2), undefined);

Low;

hvm:=if(hvp=0,15,hvp);

hv:=HHV(((V-ref(V,-1))/ref(V,-1))*100,hvm);

[color=Medium Orchid]

[linestyle=Text; textalign=Below,Center]

If(hvp and CountLo=cp and hist(barssince(BoxTop),1)<20

, round(hv,0) + "%", undefined);

Low*.97;

{ Darvas box rendering }

volOk := if(ref(hv,2*cp)>=Volsize,1,0);

breakoutOk := if(H>=ref(HHV(H,bo),-1),1,0);

firstBoxOk := breakoutOk and volOk;

normalBoxOk := breakoutOk;

dvRes := __Darvas(cp,cp,2,firstBoxOk,firstBoxOk);

TopBox := __DarvasTop(dvRes);

BottomBox := __DarvasBot(dvRes);

BoxNumber := __DarvasBoxNumber(dvRes);

inBox := BoxNumber >= 1;

startOfBox := BoxNumber > hist(BoxNumber,1);

endOfBox := (startOfBox and BoxNumber > 1) or (BoxNumber = 0 and hist(BoxNumber,1)>0);

[drawundefined=gap]

[name=Top Darvas; color=dodger blue; linestyle=HorzStep; target=Price]

TopBox;

[name=Bottom Darvas; color=dodger blue; linestyle=HorzStep]

BottomBox;

[name=Right Darvas Vertical; color=dodger blue; linestyle="Fill Bars"]

if(endOfBox,hist(TopBox,1),undefined);

if(endOfBox,hist(BottomBox,1),undefined);

[name=Left Darvas Vertical; color=dodger blue; linestyle="Fill Bars"]

if(startOfBox,TopBox,undefined);

if(startOfBox,BottomBox,undefined);



Edited by maximo - 04 Nov 2009 at 10:50am
Back to Top
peter1 View Drop Down
Regular
Regular


Joined: 27 Aug 2008
Location: Sydney
Posts: 56
Post Options Post Options   Quote peter1 Quote  Post ReplyReply Direct Link To This Post Posted: 25 Oct 2009 at 11:40am
I do not believe it.  I was considering a Darvas research project and I need a robust Darvas indicator to find all occurrences of this pattern in a chart. I have been looking at the Darvas indicator for the past week and trying to understand the logic behind the volume indicator. I haven't logged on to this forum for a while and here I see that Maximo has provided some assistance before I've even asked.

With this foresight you should be making a gazillion in the market atm Maximo. I hope you are.
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 18 Oct 2009 at 6:15pm
I have always wondered how the Darvas method of Volume is determined.
Here's an indicator to show the Volume breakout parameter of Darvas.
 
Set the Max Volume Breakout offset to 1 to show the exact day the increase occured. 
The default holding days for this volume increase is 21.
 

[Description="Darvas volume signal visualiser"]

volSize := input("Volume Breakout size %",50,0);

{ Set offset to 1 to see exact day of breakout }

volOffset := input("Max volume breakout offset",21,1);

volOk := hhv(V>hist(V,1)*(1+volSize/100),volOffset);

[linestyle=Grounded Bar; color=olive; width=2]

v2:=if(v>1000000000,v*0.15,v);

if(v2>0,v2/100000,0);

[linestyle=Solid; color=blue; width=1]

volOk*1000;

 


Edited by maximo - 18 Oct 2009 at 6:22pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz