[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

--- 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