Darvas Boxes

Category: Indicators By: dominike Created: March 15, 2016, 10:42 AM
March 15, 2016, 10:42 AM
Indicators
6 Comments

Back in the fifty, Nicolas Darvas was a wall-street personality. He used his boxes method, for automatic entry and stoploss, and made a fortune ..

Darvas identified the high of a box file once that action had not reached a high after three consecutive days and ditto for the lower limit, no new low after 3 consecutive days. Other criteria were also considered to constitute an input point.

But each overflow of the high limit once he was in position, he made a new entry with new add orders. The stop was always placed on the lower limit of the box

Warning from “hk-lisse” on his blog:

  1. Indicator introduce a bullish bias because to form a new box, we always start to draw it from the top
  2. The code make use of future price that are not known at present time
    rem from hk_lisse blog
    k=48
    once tth=undefined
    once ttl=undefined
    n=(k*2)-4
    p=(n/2)-1
    h1=dpo[n](high)
    moyh=high-h1
    hi=(moyh-moyh[1]+(high[p])/n)*n
    hi=(round(hi*100))/100
    l1=dpo[n](low)
    moyl=low-l1
    lo=(moyl-moyl[1]+(low[p])/n)*n
    lo=(round(lo*100))/100
    low1=(round(low*100))/100
    high1=(round(high*100))/100
    
    if barindex > 100 then
     if box=1 and (high1>tth or low1<ttl) then
      box=0
      flag=0
     endif
     if box=0 and flag=0 and high1>=hi[46] and high1>=hi[45] and high1>=hi[44] then
      th=high1
      flag=1
     endif
     if box=0 and flag=1 then
      for zz=0 to 44
       if  hi[47-zz-1]>th or hi[47-zz-2]>th or hi[47-zz-3]>th then
        flag=0
      break
      endif
      if lo[47-zz]<lo[47-zz-1] and lo[47-zz]<lo[47-zz-2] and lo[47-zz]<lo[47-zz-3] then
       box=1
       tth=th
       ttl=lo[47-zz]
      break
      endif
     next
    endif
    else
      tth=undefined
      ttl=undefined
     endif
      if box=1 then
       ba=ttl
      else
       ba=tth
      endif
      if box=1 then
       col=1
      else
       col=-1
      endif
    
    return ba coloured by col , tth coloured by col,ttl coloured by col

    For drawing purpose : add a fill color between the 1 and 2 return values.
    Set the first one in points, the second  and third one in large points.

Download
Filename: Darvas-Boxes1.itf
Downloads: 658
dominike Average
I usually let my code do the talking, which explains why my bio is as empty as a newly created file. Bio to be initialized...
Author’s Profile

Comments

Logo Logo
Loading...