Dear Friends of Prorealtime,
if found a Darvas Box Code for Prorealtime and for Amibroker.
I think the Amibroker Code is much more powerful.
Please can you compare the Code and translate the Amibroker Darvas Box Code for ProRealtime.
I wanna be glad if you can help me.
This is the Powerful Amibroker Code:
_SECTION_BEGIN(“Darvas Box”);
Periods= Param(“Darvas Periods”,5,5,260);
boxHigh = Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND
Ref(H,-3)>Ref(H,-2) AND Ref(H,-3)>Ref(H,-1) AND Ref(H,-3)>H;
Topbox=ValueWhen(boxHigh, Ref(H,-3));
Botbox=ValueWhen(boxHigh,LLV(L,4));
/*=========================
– Allow color change
– Style change
==========================*/
Plot(TopBox, “Top”, ParamColor(“Box Top Color”, colorRed), ParamStyle(“Box Top Style”));
Plot(Botbox, “Bot”, ParamColor(“Box Bottom Color”,colorBlue), ParamStyle(“Box Bottom Style”));
_SECTION_END();
And this is the much longer Darvas PRT Code.
k=50
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 low1<=lo[46] and low1<=lo[45] and low1<=lo[44] then
th=low1
flag=1
endif
if box=0 and flag=1 then
for zz=0 to 44
if lo[47-zz-1]<th or lo[47-zz-2]<th or lo[47-zz-3]<th then
flag=0
break
endif
if hi[47-zz]>hi[47-zz-1] and hi[47-zz]>hi[47-zz-2] and hi[47-zz]>hi[47-zz-3] then
box=1
ttl=th
tth=hi[47-zz]
break
endif
next
endif
else
tth=undefined
ttl=undefined
endif
if box=1 then
ba=ttl
else
ba=tth
endif
return ba coloured by box-1, tth coloured by box-1, ttl coloured by box-1
So please, can you translate the Amibroker Code, to use is in PRT.
See the tow Pictures of United Heath! The Amibroker Code is much more better for Stop Loss 🙂