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

Re: [amibroker] help!!!!!



PureBytes Links

Trading Reference Links


Thanks guys,
Tomasz did give me the clues. I will go to the AB library and put this together because I haven't program before.  Will learn array.
 
Reguard,
AlexTomasz Janeczko <amibroker@xxxxxx> wrote:




Hello,
 
Recipe:
 
1. Replace all
Zig( array, value, % ) 
with just 
Zig( array, value )
 
 
2. replace 
 
ValueWhen( Nth, array1, array2 )
with
ValueWhen( array1, array2, Nth )
 
3. Replace 
Ref(C1,-1)=0 
with 
Ref(C1,-1) == 0
 
 
Best regards,Tomasz Janeczkoamibroker.com

----- Original Message ----- 
From: alex huynh 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Thursday, November 13, 2003 9:57 PM
Subject: RE: [amibroker] help!!!!!

I tried AFL and I got stuck
 
input AB:
 
//Divergence FormulasEKA=3;I1=Zig(CCI(14),EKA,%)>Ref(Zig(CCI),EKA,%),-1) AND Ref(Zig(CCI(14),EKA,%),-1)<Ref(Zig(CCI(14),EKA,%),-2);V1=ValueWhen(1,I1,Ref(Zig(CCI(14),EKA,%),-1));V2=ValueWhen(1,I1,Ref(C,-1));V3=ValueWhen(2,I1,Ref(Zig(CCI(14),EKA,%),-1));V4=ValueWhen(2,I1,Ref(C,-1));C1=V1>V3 AND V2<V4;C1 AND Ref(C1,-1)=0 AND CCI(14)>Ref(CCI(14),-1);//Double successive divergenceI1=Zig(CCI(14),3,%)>Ref(Zig(CCI(14),3,%),-1) ANDRef(Zig(CCI(14),3,%),-1)<Ref(Zig(CCI(14),3,%),-2);V1=ValueWhen(1,I1,Ref(Zig(CCI(14),3,%),-1));V2=ValueWhen(1,I1,Ref(C,-1));V3=ValueWhen(2,I1,Ref(Zig(CCI(14),3,%),-1));V4=ValueWhen(2,I1,Ref(C,-1));V5=ValueWhen(3,I1,Ref(Zig(CCI(14),3,%),-1));V6=ValueWhen(3,I1,Ref(C,-1));C1=V1<V3 AND V2>V4 AND V3<V5 AND V4>V6;C1 AND Ref(C1,-1)=0 AND CCI(14)>Ref(CCI(14),-1);
 
Jayson <jcasavant@xxxxxxxxxxx> wrote:


Perhaps you could try converting them your self then post here if you get stuck. You will find that AFL is not that different from the MS formula language you are used to. 
 
Regards, 
Jayson 
-----Original Message-----From: ahuynh7 [mailto:ahuynh7@xxxxxxxxx]Sent: Thursday, November 13, 2003 2:51 PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] help!!!!!I have two formulas from Metastocks need to convert into AFL. The first one is Divergence and second is zero lag filter. Any other CCI or TRIX formula is welcome. Thanks you in advanced for your help!First://Divergence FormulasEKA:=3;I1:=Zig(CCI(14),EKA,%)>Ref(Zig(CCI),EKA,%),-1) AND Ref(Zig(CCI(14),EKA,%),-1)<Ref(Zig(CCI(14),EKA,%),-2);V1:=ValueWhen(1,I1,Ref(Zig(CCI(14),EKA,%),-1));V2:=ValueWhen(1,I1,Ref(C,-1));V3:=ValueWhen(2,I1,Ref(Zig(CCI(14),EKA,%),-1));V4:=ValueWhen(2,I1,Ref(C,-1));C1:=V1>V3 AND V2<V4;C1 AND Ref(C1,-1)=0 AND CCI(14)>Ref(CCI(14),-1)//Double successive
 divergenceI1:=Zig(CCI(14),3,%)>Ref(Zig(CCI(14),3,%),-1) ANDRef(Zig(CCI(14),3,%),-1)<Ref(Zig(CCI(14),3,%),-2);V1:=ValueWhen(1,I1,Ref(Zig(CCI(14),3,%),-1));V2:=ValueWhen(1,I1,Ref(C,-1));V3:=ValueWhen(2,I1,Ref(Zig(CCI(14),3,%),-1));V4:=ValueWhen(2,I1,Ref(C,-1));V5:=ValueWhen(3,I1,Ref(Zig(CCI(14),3,%),-1));V6:=ValueWhen(3,I1,Ref(C,-1));C1:=V1<V3 AND V2>V4 AND V3<V5 AND V4>V6;C1 AND Ref(C1,-1)=0 AND CCI(14)>Ref(CCI(14),-1)Second:// zero lag IIR filterpds:=Input("number of periods",1,20,5);x:=2/(pds+1);xI:=LastValue((1/x)-1);(x*((2*C)-Ref(C,-xI)))+((1-x)*PREV)// zero lag FIR filter(C+(3.5*Ref(C,-1))+(4.5*Ref(C,-2))+(3*Ref(C,-3))+(.5*Ref(C,-4))-(.5*Ref(C,-5))-(1.5*Ref(C,-6)))/10.5Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to:
 amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: <A
 href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


Do you Yahoo!?Protect your identity with Yahoo! Mail AddressGuard Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.