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

[amibroker] help!!!!!



PureBytes Links

Trading Reference Links

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 Formulas
EKA:=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 divergence
I1:=Zig(CCI(14),3,%)>Ref(Zig(CCI(14),3,%),-1) AND
Ref(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 filter
pds:=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.5



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/