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

Re: Can amibroker AFL detect support resistance levels ?



PureBytes Links

Trading Reference Links

endt1 is the number bars (counted from the beginning of your data) 
assigned to
the last peak.
startt1 is the number for the previous peak.
dtR is the time interval between the peaks.
dH is the vertical difference between peaks(last-previous)
So,
if you want the last peak more than 15 days ago, then

endt1<=Lastvalue(x)-15

if you want the first peak whithin the last 40 trading days, then

startt1>=Lastvalue(x)-40

if you want the interval between peaks less than 25 days, then

dtr<=25

and if you want vertical diff less than 1$, then

abs(dH)<=1

Is it more clear now?

DT
--- In amibroker@xxxx, man581@xxxx wrote:
> --- In amibroker@xxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> wrote:
> > Here is the Exploration
> > 
> > x = Cum(1);
> > per = 3;
> > s11=H;
> > pR = PeakBars( s11, per, 1 ) == 0;
> > endt1= LastValue(ValueWhen( pR, x, 1 ));
> > startt1=LastValue(ValueWhen( pR, x, 2 ));
> > dtR =endt1-startt1;
> > endR = LastValue(ValueWhen( pR, s11, 1 ) );
> > startR = LastValue( ValueWhen( pR, s11, 2 ));
> > dH=endR-startR;
> > Filter=endt1<=LastValue(x)-10 
> > AND 
> > endt1>=LastValue(x)-20 
> > AND 
> > dtr>=5 
> > AND 
> > dtr<=30 
> > AND 
> > abs(dH)<0.1*endR;
> > NumColumns=3;
> > Column0=endR;Column0Name="Last Peak";
> > Column1=startR;Column1Name="Previous Peak"; 
> > Buy=Cum(1)==startt1;
> > Sell=Cum(1)==endt1;
> > 
> > Notes :
> > 1. From per=3 you calibrate the sensitivity of peak recognition
> > 2. Buy and Sell are just for the visual part, to see your points.
> > 3. I ask in abs(dH)<0.1*endR the vertical distance between peaks
> > to be less than 0.1 of the last peak.
> > You may change this with
> > abs(dH)<0.15
> > but you are restricted enough.(For a stock with values around 1$ 
is
> > big, for IBM is very small.
> > 4. Explore all stocks for the last day of your data.
> > Dimitris Tsokakis
> 
> Thank you very much Dimitris. I get exactly what I wanted and this 
> formula will be very helpful.
> A question still: what parameter should I change to define how much 
> days I want between peak1 to peak 2 ?
> 
> So I can set the value between lets say 10 (minimum) and 30 (max) ?
> 
> Thanks,
> Email