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

Re: The D-ratio and its application



PureBytes Links

Trading Reference Links

Greg,
The D-ratio is quite unsmoothed and HHV, LLV methods will be full of 
whipsaws.
Anyway, if you want to experiment, the formula is

R=500*(H-L)/(H+L);
Z=Optimize("Z",20,5,20,5);
RRR=DEMA(R,Z);
X=Optimize("X",5,5,40,5);
H1=HHV(RRR,X);L1=LLV(RRR,X);
S1=L1<RRR AND Ref(L1,-1)==Ref(RRR,-1);
S2=H1==RRR AND Ref(H1,-1)>Ref(RRR,-1);
B1=H1>RRR AND Ref(H1,-1)==Ref(RRR,-1);
B2=L1==RRR AND Ref(L1,-1)<Ref(RRR,-1);
Y1=Optimize("Y1",1,1,2,1);Y2=Optimize("Y2",1,1,2,1);
Buy=IIf(Y1==1,B1,B2);
Sell=IIf(Y2==1,S1,S2);
Short=Sell;Cover=Buy;

S1 and S2 are the probable Sell conditions
B1 and B2 are the probable Buy conditions.
DT 
--- In amibroker@xxxx, "greg" <greg.bean@xxxx> wrote:
> Dimitris,
> 
> I haven't run a complete optimization yet. It looks like it will 
tie up my computer for a long time, so I'll try later.
> Something I've noticed when looking at INTC chart, is that there is 
a long buy at 24/09/01 ending at 22/10/01. There was more that could 
have been made after this trade ended but no signals from the afl as 
it is now. When I look at the D-Ratio chart pane it looks like maybe 
using HHV and LLV of the yellow line would give might get more out of 
a trade. Peak to trough of yellow would be a long buy and trough to 
peak would be a short. I don't think I have the know how to rearrange 
your afl to test for results using the yellow line for buy and sell 
signals, if this approach interests you, maybe you would be so kind 
to try it out and let me know what your results are. I'm looking 
forward to reading your comments and hope that my comments will be 
useful.
> 
> Greg
> ----- Original Message ----- 
> From: Dimitris Tsokakis 
> To: amibroker@xxxx 
> Sent: Monday, June 24, 2002 6:01 AM
> Subject: [amibroker] The D-ratio and its application
> 
> 
> A. Definition
> The D-ratio is defined as
> D-ratio = 500*(H-L)/(H+L)
> To avoid sudden spikes but keep the line properties, it is useful 
to consider a fast moving average like 
> DEMA(D-ratio,5), which usually oscillates in the [0,100] region.
> Slightly negative values or values above 100 may appear, but not 
frequently.
> B. Range
> The range of D-ratio and its DEMA comes from the Exploration
> /*D-ratio range*/
> R=500*(H-L)/(H+L);
> Z=5;
> RRR=DEMA(R,Z);
> Rmin=LastValue(Lowest(R));RminF=floor(LastValue(Lowest(R)))+1;
> Rmax=LastValue(Highest(R));RmaxC=ceil(LastValue(Highest(R)))-1;
> RRRmin=LastValue(Lowest(RRR));RRRminF=floor(LastValue(Lowest
(RRR)))+1;
> RRRmax=LastValue(Highest(RRR));RRRmaxC=ceil(LastValue(Highest
(RRR)))-1;
> Filter=1;
> AddColumn(R,"D-ratio");
> AddColumn(RRR,"DEMA D-ratio");
> AddColumn(Rmax,"HIGHEST D-ratio");
> AddColumn(Rmin,"LOWEST D-ratio");
> AddColumn(RRRmax,"HIGHEST DEMA D-ratio");
> AddColumn(RRRmin,"LOWEST DEMA D-ratio");
> 
> Explore for the n=1 last quotation.
> For N100 stocks, the ,"HIGHEST DEMA D-ratio" varies from 23 to 95 
and the 
> "LOWEST DEMA D-ratio" from 2 to 10.
> C. Applications
> The D-ratio or its smoothed form may give interesting trading 
systems.
> Search various low levels for the Sell level D1 and various high 
levels for the Buy Level D2.
> You may search the optimal D1, D2 following the optimization
> /*D-ratio optimized trading system*/
> R=500*(H-L)/(H+L);
> Z=Optimize("Z",20,5,20,5);
> RRR=DEMA(R,Z);
> Rmin=LastValue(Lowest(R));RminF=floor(LastValue(Lowest(R)))+1;
> Rmax=LastValue(Highest(R));RmaxC=ceil(LastValue(Highest(R)))-1;
> RRRmin=LastValue(Lowest(RRR));RRRminF=floor(LastValue(Lowest
(RRR)))+1;
> RRRmax=LastValue(Highest(RRR));RRRmaxC=ceil(LastValue(Highest
(RRR)))-1;
> Filter=1;
> AddColumn(R,"D-ratio");
> AddColumn(RRR,"DEMA D-ratio");
> AddColumn(Rmax,"HIGHEST D-ratio");
> AddColumn(Rmin,"LOWEST D-ratio");
> AddColumn(RRRmax,"HIGHEST DEMA D-ratio");
> AddColumn(RRRmin,"LOWEST DEMA D-ratio");
> AddColumn(RRRmaxC,"HIGHEST DEMA D-ratio C");
> AddColumn(RRRminF,"LOWEST DEMA D-ratio F");
> D1=Optimize("D1",13,RRRminF,RRRminF+0.5*(RRRmaxC-RRRminF),1);
> D2=Optimize("D2",17,RRRminF+0.5*(RRRmaxC-RRRminF),RRRmaxC,1);
> F1=RRR>=D2;F2=RRR<=D1;
> Sell=F2;Buy=F1;
> Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
> Short=Sell;Cover=Buy;
> Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
> 
> For your indicator builder use the 
> /*D-ratio graph*/
> 
> R=500*(H-L)/(H+L);
> Z=Optimize("Z",20,5,20,5);
> RRR=DEMA(R,Z);
> Rmin=LastValue(Lowest(R));RminF=floor(LastValue(Lowest(R)))+1;
> Rmax=LastValue(Highest(R));RmaxC=ceil(LastValue(Highest(R)))-1;
> RRRmin=LastValue(Lowest(RRR));RRRminF=floor(LastValue(Lowest
(RRR)))+1;
> RRRmax=LastValue(Highest(RRR));RRRmaxC=ceil(LastValue(Highest
(RRR)))-1;
> D1=Optimize("D1",13,RRRminF,RRRminF+0.5*(RRRmaxC-RRRminF),1);
> D2=Optimize("D2",17,RRRminF+0.5*(RRRmaxC-RRRminF),RRRmaxC,1);
> F1=RRR>=D2;F2=RRR<=D1;
> Sell=F2;Buy=F1;
> Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
> Short=Sell;Cover=Buy;
> Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
> Plot(R,"D-ratio",1,1);Plot(RRR,"DEMA D-ratio",7,8);
> Plot(D2,"Buy Level",5,1);Plot(D1,"Sell Level",4,1);
> 
> Do not forget to replace above default values for Z, D1, D2 with 
your optimization results.
> In general, when the DEMA(D-ratio) is below the red line the 
stock is Sell [or Short] and 
> above the green line it is Buy [or Cover]
> You may see INTC example in the att. gif.
> [for [Z=5, D1=13, D2=17] the % Net profit exceeds +800% from Jan 
2000]
> 
> 
> 
> 
> Yahoo! Groups Sponsor 
> ADVERTISEMENT
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.