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

[amibroker] Re: help converting metastock code to AFL



PureBytes Links

Trading Reference Links

I also have addcolumn as follows with my filter:

AddColumn(C, "Close", 1.3);
AddColumn(P4, "Last Peak", 1.3);
AddColumn(P5,"Last Trough",1.3);





--- In amibroker@xxxxxxxxxxxxxxx, "xxxringop" <xxxringop@xxx> wrote:
>
> This is what I have, but I know it not correct.  
> 
> 
> Pa = trough(low,5,4);
> 
> Pb = peak(high,5,4);
> 
> P1 = trough(low,5,3);
> 
> P2 = peak(high,5,3);
> 
> P3 = trough(low,5,2);
> 
> P4 = peak (high,5,2);
> 
> P5 = trough(low,5,1);
> 
> Tb = troughbars(low,5,1);
> 
> TBA = iif(tb<=4 and p1 >pa and pb>p2 and p1<p4 andp1>p3 and p3>p5 
> and p4<p2,1,0);
> 
> P1 = trough(low,5,3);
> 
> P3 = trough(low,5,2);
> 
> P5 = trough(low,5,1);
> 
> O1 = p1-p3;
> 
> 02 = p1-p3;
> 
> A1 = troughbars(low,5,3)-troughbars(low,5,2);
> 
> A2 = troughbars(low,5,3)-troughbars(low,5,1);
> 
> Tan1 = o1/a1;
> 
> Tan2 = o2/a2;
> 
> TBB = abs (tan1-tan2);
> 
> Filter = Iif(TBA and TBB <=.2,2,0);
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Fred" <ftonetti@> wrote:
> >
> > Ok ... show us what you have so far in the conversion process 
and 
> > what you are having trouble with ...
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "xxxringop" <xxxringop@> wrote:
> > >
> > > Well, it is a Metastock formula for scanning.  I need help to 
> > > convert it to AFL.  My programming skill are still weak.  
Thanks.
> > > 
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Bob Jagow" <bjagow@> wrote:
> > > >
> > > > Help you convert this code?
> > > > 
> > > > -----Original Message-----
> > > > From: amibroker@xxxxxxxxxxxxxxx 
> > [mailto:amibroker@xxxxxxxxxxxxxxx]
> > > On
> > > > Behalf Of xxxringop
> > > > Sent: Tuesday, November 28, 2006 2:53 PM
> > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > Subject: [amibroker] help converting metastock code to AFL
> > > > 
> > > > 
> > > > Hello,
> > > > 
> > > > Can someone help me convert this metastock code into an AFL 
> > scan?  
> > > > THANKS!
> > > > 
> > > > The metastock code:
> > > > 
> > > > Column A :
> > > > 
> > > > Pa:=Trough(4,LOW,5);
> > > > Pb:=Peak(3,HIGH,5);
> > > > P1:=Trough(3,LOW,5);
> > > > P2:=Peak(2,HIGH,5);
> > > > P3:=Trough(2,LOW,5);
> > > > P4:=Peak(1,HIGH,5);
> > > > P5:=Trough(1,LOW,5);
> > > > tb:=TroughBars(1,LOW,5);
> > > > tb<=4 AND
> > > > p1 > pa AND
> > > > pb < p2 AND
> > > > p1 < p2 AND
> > > > p1 < p4 AND
> > > > p1 > p3 AND
> > > > p3 > p5 AND
> > > > p4 < p2 
> > > > 
> > > > 
> > > > Column B :
> > > > Tangents
> > > > 
> > > > p1:=Trough(3,LOW,5);
> > > > p3:=Trough(2,LOW,5);
> > > > p5:=Trough(1,LOW,5);
> > > > o1:=p1-p3;
> > > > o2:=p1-p5;
> > > > a1:=TroughBars(3,LOW,5)-TroughBars(2,LOW,5);
> > > > a2:=TroughBars(3,LOW,5)-TroughBars(1,LOW,5);
> > > > tan1:=o1/a1;
> > > > tan2:=o2/a2;
> > > > Abs(tan1-tan2)
> > > > 
> > > > Filter:
> > > > 
> > > > colA AND colB <= .2
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Please note that this group is for discussion between users 
> only.
> > > > 
> > > > To get support from AmiBroker please send an e-mail directly 
> to 
> > > > SUPPORT {at} amibroker.com
> > > > 
> > > > For NEW RELEASE ANNOUNCEMENTS and other news always check 
> DEVLOG:
> > > > http://www.amibroker.com/devlog/
> > > > 
> > > > For other support material please check also:
> > > > http://www.amibroker.com/support.html
> > > >  
> > > > Yahoo! Groups Links
> > > >
> > >
> >
>



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.15.2/560 - Release Date: 11/30/2006 3:41 PM