[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Darvas Box Indicator?



PureBytes Links

Trading Reference Links




As everyone can see, there is much confusion about how to draw the 
"correct" boxes.
 
After looking at various examples on the 'net, I based my code almost 
entirely on <A 
href="">http://www.gerryco.com/tech/darvas.html.  
My code inside the 'for' loop is essentially just implementing the state machine 
presented on that site.
 
However, I became interested in Darvas after attending the last Perth 
Sunday Traders Club meeting where Frank Watkins made a presentation on his 
ProTrader software.  One of the pictures (p17) in Frank's booklet "Darvas 
Box Trading" suggests that his software requires the first new high to be a 
New n-day High.  I have not seen this requirement mentioned anywhere else 
and my code does not use this precondition.  I also did not add this 
requirement as I was trying to get into a new trend closer to the bottom than 
this would otherwise allow.  YMMW.
 
As Stan said, what Darvas is basically looking for is a new High that 
is not exceeded for 2 subsequent days, followed by a new Low that is not 
penetrated for 2 subsequent days.  (This is why you can't use 
functions like HHV() and LLV() directly out-of-the-box to construct Darvas 
Boxes.  You can of course - it just gets messy).  The Low may also be 
the Low of the day of the first New High.  This works well in an uptrend 
but sucks in a down trend.  However, if we are only to trade longs, then 
these rules work well.
 

There are many shortcomings of the rules as strictly presented.  
One in particular that I noticed was that after a sharp drop into a 
bottom, the top of the Darvas box is stuck back at a long-inconsequential, 
old-time High.  This is because we cannot claim to have found a box until a 
qualified Low is found after a qualified High.  It just happens that 
in a downtrend the last qualified High is often a long time ago.  Therefore 
we don't get our first Buy signal out of the bottom until that long-old High is 
broken.  But no mechanical system is perfect to we'd all better just 
get used to it.
 
I have drawn "Darvas Channels".  This so that I could see the boxes 
form as the days progressed but also to cater for the Hard Right Edge (see next 
paragraph).  As each Low is violated, the state machine re-syncs and the 
bottom of the box is moved lower.  But my code does not go back and fixup 
the box (channel) bottom.  Same situation as each new High is made; the top 
of the box (channel) gets moved up.  So my boxes are not "the same" as 
examples seen elsewhere but the meat of the box, once it's 
formed, should be absolutely correct.
 
I chose not to draw boxes strictly according to Darvas.  
However, the code could be modified to go back and fix things up ("And the Angel 
wants to go back and fix things.  To repair the things that have been 
broken" - Laurie Anderson's "The Dream Before").  I chose this because 
at the Hard Right Edge boxes are only partially 
formed.  It is not until some time in the future that we have all 
the information need to construct the box.  i.e. the box often cannot be 
validly drawn until after price has broken out of the box and the Buy signal has 
occurred.  Too late!  I prefer to see the box forming.  I also 
prefer NOT to see things drawn one way one day and suddenly change the 
next.  YMMW.
 
Let's keep in mind that strict adherence to the Darvas rules are not what's 
important here; it's whether what we come up with can be used to make 
money.  No mechanical system is perfect.  Let's get over the "Holy 
Grail"-itis.  It's like people who ask whether a 20 day (E)MA is better 
than a 21 or 25 or 'n' day (E)MA.  Sheesh!  Get over it and trade 
the sucker.
 
Anyway, I hope this explanation helps people to understand my code and 
helps them decide how they would like to modify it if they choose.  
Enjoy.
 
Ciao!
 
Paul
 

CRITICISMHe has the right to 
criticizewho has the heart to help.     - 
Abraham Lincoln
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=gkavanagh@xxxxxxxxxxxxx 
  href="">Graham 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Thursday, 18 September 2003 4:13 
  PM
  Subject: RE: [amibroker] Re: Darvas Box 
  Indicator?
  Here is a MS code for one from<A 
  href="">http://www.euro-info.com.pl/kr/AFM/e-w-Darvas_Box.htmlDarvas 
  Box 
  LowL:=If(Low=LLV(Low,5),Low,If(Ref(Low,-1)=LLV(Low,5),Ref(Low,-1),If(Ref(Low,-2)=LLV(Low,5),Ref(Low,-2),If(Ref(Low,-3)=LLV(Low,5),Ref(Low,-3),If(Ref(Low,-4)=LLV(Low,5),Ref(Low,-4),0)))));NewH:=ValueWhen(1,High>Ref(HHV(High,5),-1),High);box1:=HHV(High,3)<HHV(High,4);box2:=ValueWhen(1,BarsSince(High>Ref(HHV(High,5),-1))=3 
  AND 
  box1=true,NewH);box3:=ValueWhen(1,BarsSince(High>Ref(HHV(High,5),-1))=3 
  AND 
  box1=true,LowL);TopBox:=box2;BottomBox:=box3;TopBox;BottomBox;Cheers,Graham<A 
  href="">http://groups.msn.com/ASXShareTrading<A 
  href="">http://groups.msn.com/FMSAustralia-----Original 
  Message-----From: stvd2002 [mailto:stanvol@xxxxxxxxxxxxxx] Sent: 
  Thursday, 18 September 2003 4:05 PMTo: 
  amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: Darvas Box 
  Indicator?I know, and I believe the script for wealthlab is 
  written  on the the basis  of this <A 
  href="">http://www.gerryco.com/tech/darvas.htmlBut 
  I've installed Guppy trader essential software and it draws the bottoms of 
  some boxes differently.  I realy cannot comment on the proper 
  definition on the construction.  Maybe <A 
  href="">http://www.gerryco.com/tech/darvas.html 
  is the correct definition and the software from <A 
  href="">http://www.guppytraders-essentials.com 
  could draw them incorrectly,  which I doubt.  Anybody 
  can download a trial version and see for themselves.  I apologise for 
  confusing everyone   :-)Stan--- In 
  amibroker@xxxxxxxxxxxxxxx, "Stephane Carrasset" <nenapacwanfr@xxxx> 
  wrote:> Tha darvas box in box.dll have been written according to 
  > <A 
  href="">http://www.gerryco.com/tech/darvas.html> 
  > stephane> > The top of the box is established when the 
  stock does not touchor > > penetrate a previously set new high 
  for three consecutive days.> > This is true in reverse for the 
  bottom of the box.  The bottom > > starts one day after the 
  top.  > > > > But I'm not 100% sure either because I 
  don't have the book> myself.   > > Anyone who has 
  the book please feel free to correct me.> > > > 
  Stan> > > > > > --- In 
  amibroker@xxxxxxxxxxxxxxx, "mleonsprint"<mleonsprint@xxxx> > 
  > wrote:> > > What do you consider a correct "Darvas" 
  box?> >  > >  > >  > > 
  > --- In amibroker@xxxxxxxxxxxxxxx, "stvd2002" 
  <stanvol@xxxx>wrote:> > > > I'm also currently 
  experimenting with darvas boxes,> > unfortunately> > > 
  > the box.dll in the 3rd party draw them inaccurately.> > > 
  >  > > > > There is a script on a WealthLab site that 
  draws darvasboxes, > > but> > > > again it draws 
  them inaccurately.> > > >  > > > > 
  However I could be wrong, because I've noticed that samepeople > 
  > > have> > > > different definitions of how to 
  construct them, therefore I> > admit> > > > that I'm 
  bit confused myself :-)> > > >  > > > > 
  There is a software from Australian trader by the name ofDaryl > 
  > > > Guppy and his softWare draws them correctly.> > > 
  > <A 
  href="">http://www.guppytraders-essentials.com/> 
  > > >  > > > >  > > > > 
  Regards> > > > Stan> > > > > > > 
  > --- In amibroker@xxxxxxxxxxxxxxx, "mroman59" 
  <mroman59@xxxx>> > wrote:> > > > > Hello, 
  has anyone heard of or tried to create a Darvas Box> > > > 
  > indicator?  The Darvas Box investing technique derives from 
  > > the> > > > > books How I made $2 million in 
  the Stock Market by Nicolas> > > Darvas.> > > > 
  > If anyone has come across any websites that could assitsin > 
  > > > > programing code for this indicator, I would 
  greatly> appreciate> > > it.> > > > > 
  > > > > > Thank You> > > > > 
  MR------------------------ Yahoo! Groups Sponsor 
  ---------------------~--> BuyRemanufactured Ink Cartridges & Refill 
  Kits at MyInks.com for: HP $8-20.Epson $3-9, Canon $5-15, Lexmark $4-17. 
  Free s/h over $50 (US & Canada).<A 
  href="">http://www.c1tracking.com/l.asp?cid=6351<A 
  href="">http://us.click.yahoo.com/0zJuRD/6CvGAA/qnsNAA/GHeqlB/TM---------------------------------------------------------------------~->Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at:<A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to <A 
  href="">http://docs.yahoo.com/info/terms/ 
  Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.