Dear Vinay and Paul;
I hope if you try this as
change chammer to cdhammer and
write MA in place of gauss2ord.
I hope this will work.
Thanks
--- On Tue, 12/8/08, Ara Kaloustian <ara1@xxxxxxxxxx> wrote:
From: Ara Kaloustian <ara1@xxxxxxxxxx> Subject: Re: [SPAM]Re: [amibroker] Fibonacci To: amibroker@xxxxxxxxxxxxxxx Date: Tuesday, 12 August, 2008, 12:04 AM
Thanks to all who responded to this thread. This is good code!
Ara
----- Original Message -----
Sent: Monday, August 11, 2008 6:08 AM
Subject: Re: [SPAM]Re: [amibroker] Fibonacci
Hello,
Corrected code is attached.
Cheers
Prashanth
----- Original Message -----
Sent: Monday, August 11, 2008 1:28 PM
Subject: Re: [SPAM]Re: [amibroker] Fibonacci
Hi Pondy,
as a non programer this looks very interesting, many thanks for sharing your hard work.
Similar to Vinay i have the same error's and i'm also unable to resolve them due to the fact that i've had to admitt to myself that this programing isn't going to happen for me.
Hope you see our posts and suggest a fix as i'd like to play with your code some more ,at this stage i've just commented out those two lines.
warm regards
Paul
----- Original Message -----
Sent: Monday, August 11, 2008 4:30 AM
Subject: RE: [SPAM]Re: [amibroker] Fibonacci
I get a Syntax error on this line after “CHammer”.
(AddColumn(CdDoji( )OR CHammer(),"Candle" ,1.0);)
And after
Plot(Gauss2ord( C,5),"M5",4, 1);
Could you please advise the correct syntax or is there some other code that I may be missing. I am using version 5.16
Thanks & Regards
From: amibroker@xxxxxxxxx ps.com [mailto: amibroker@xxxxxxxxx ps.com ] On Behalf Of pondy Sent: Sunday, August 10, 2008 11:44 AM To: amibroker@xxxxxxxxx ps.com Subject: [SPAM]Re: [amibroker] Fibonacci
I have Commented two lines of code.... Now the Afl shall give the desired result...
//////////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// //
_SECTION_BEGIN
("Fibonacci");
//Date: 12-January 2002 by Thomas Zmuck
Offset =
5; //use two sheets: one with 5 and another with 7, or maybe other offset value
Avgmov = Offset*
MA(abs(ROC(C,1)),20);
per =
LastValue(Avgmov);
x=
Cum(1); Range = 0.01;
PS =
TroughBars(L,per,1) == 0;
xa =
LastValue(ValueWhen(PS,x,1));//x from last trough
Ya =
LastValue(ValueWhen(PS,L,1));//y (Low) last trough
PR =
PeakBars(H,per,1) == 0;
xb =
LastValue(ValueWhen(PR,x,1));//x from last peak
Yb =
LastValue(ValueWhen(PR,H,1));//y (High) last peak
Trough_ReTest =
abs((L/ya)-1)<Range;
Peak_ReTest =
abs((H/yb)-1)<Range;
Trough_Cross =
Cross(ya,C);
Peak_Cross =
Cross(C,yb);
//UP = upSwing DN = downSwing
UP = xb>xa;
//upSwing
DN = xa>xb;
//DownSwing
RT23_6 =
IIf(UP,yb-(yb-ya) *0.236,IIf(DN,ya+(yb-ya) *0.236,-1e10));
RT38_2 =
IIf(UP,yb-(yb-ya) *0.382,IIf(DN,ya+(yb-ya) *0.382,-1e10));
RT50_0 =
IIf(UP,yb-(yb-ya) *0.500,IIf(DN,ya+(yb-ya) *0.500,-1e10));
RT61_8 =
IIf(UP,yb-(yb-ya) *0.618,IIf(DN,ya+(yb-ya) *0.618,-1e10));
RT78_6 =
IIf(UP,yb-(yb-ya) *0.786,IIf(DN,ya+(yb-ya) *0.786,-1e10));
RT=
IIf
(UP,-100*(yb-L)/(yb-ya),
100
*(H-ya)/(yb-ya) );//Retracement_ Value
InZone = C<yb & C>ya;
//use it for filter to receive only signals that are in in the Retracement zone.
Buy
= Trough_ReTest OR peak_Cross;
Sell
= Peak_ReTest OR trough_Cross;
Filter
= 1;
AddColumn
(RT,"RT%");
AddColumn
(Trough_ReTest,"TR-Test",1.0);
AddColumn
(Peak_ReTest,"PK-Test",1.0);
AddColumn
(Trough_Cross,"TR-Cross",1.0);
AddColumn
(Peak_Cross,"PK-Cross",1.0);
//
AddColumn(CdDoji( )OR CHammer(),"Candle" ,1.0);
Plot
(C,"C",1,64);
Plot
(IIf(x>xa,ya,-1e10),"Bottom",colorBrown,1+8);
Plot
(IIf(x>xb,yb,-1e10),"Top",colorBrown,1+8);
xab =
IIf(xb>xa,xb,xa);
//Retracements
Plot
(IIf(x>=xab+1,RT23_6,-1e10),"23,6% Retr.",5,1);
Plot
(IIf(x>=xab+1,RT38_2,-1e10),"38,2% Retr.",5,1);
Plot
(IIf(x>=xab+1,RT50_0,-1e10),"50,0% Retr.",colorBlue,1);
Plot
(IIf(x>=xab+1,RT61_8,-1e10),"61,8% Retr.",colorYellow,1);
Plot
(IIf(x>=xab+1,RT78_6,-1e10),"78,6% Retr.",colorYellow,1);
GraphXSpace
= 0.5;
//
Plot(Gauss2ord( C,5),"M5",4, 1);
GraphXSpace
= 1.5;
Title
= Name()+" per = "+WriteVal(per,1.0) +" Close = "+WriteVal(C,1.2)+ " ("+WriteVal(ROC(C,1),1.2)+"%)"+_SECTION_END
();
Best Regards,
Thanks for the response .....
I was asking what else do you need to run the code, because this code calls a couple of functions that are external ... so there is either a DLL or an include file associated with this ...
----- Original Message -----
Sent: Thursday, July 31, 2008 1:26 AM
Subject: Re: [amibroker] Fibonacci
Fibonacci code written by Thomas Zmuck in 2002
//////////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// //
_SECTION_BEGIN( "Fibonacci" ); //Date: 12-January 2002 by Thomas Zmuck //thomas.zm@ aon.at
Offset = 5; //use two sheets: one with 5 and another with 7, or maybe other offset value Avgmov = Offset*MA(abs( ROC(C,1)) ,20);
per = LastValue(Avgmov) ; x=Cum(1); Range = 0.01; PS = TroughBars(L, per,1) == 0; xa = LastValue(ValueWhen (PS,x,1)) ;//x from last trough Ya = LastValue(ValueWhen (PS,L,1)) ;//y (Low) last trough PR = PeakBars(H,per, 1) == 0; xb = LastValue(ValueWhen (PR,x,1)) ;//x from last peak Yb = LastValue(ValueWhen (PR,H,1)) ;//y (High) last peak
Trough_ReTest = abs((L/ya)-1)<Range; Peak_ReTest = abs((H/yb)-1)<Range; Trough_Cross = Cross(ya,C); Peak_Cross = Cross(C,yb);
//UP = upSwing DN = downSwing UP = xb>xa;//upSwing DN = xa>xb;//DownSwing
RT23_6 = IIf(UP,yb-(yb- ya)*0.236, IIf(DN,ya+ (yb-ya)*0. 236,-1e10) ); RT38_2 = IIf(UP,yb-(yb- ya)*0.382, IIf(DN,ya+ (yb-ya)*0. 382,-1e10) ); RT50_0 = IIf(UP,yb-(yb- ya)*0.500, IIf(DN,ya+ (yb-ya)*0. 500,-1e10) ); RT61_8 = IIf(UP,yb-(yb- ya)*0.618, IIf(DN,ya+ (yb-ya)*0. 618,-1e10) ); RT78_6 = IIf(UP,yb-(yb- ya)*0.786, IIf(DN,ya+ (yb-ya)*0. 786,-1e10) ); RT= IIf(UP,-100* (yb-L)/(yb- ya), 100*(H-ya)/( yb-ya));/ /Retracement_ Value
InZone = C<yb & C>ya;//use it for filter to receive only signals that are in in the Retracement zone.
Buy = Trough_ReTest OR peak_Cross; Sell = Peak_ReTest OR trough_Cross;
AddColumn(RT, "RT%"); AddColumn(Trough_ ReTest,"TR-Test" ,1.0); AddColumn(Peak_ ReTest,"PK-Test" ,1.0); AddColumn(Trough_ Cross,"TR-Cross" ,1.0); AddColumn(Peak_ Cross,"PK-Cross" ,1.0); AddColumn(CdDoji( )OR CHammer(),"Candle" ,1.0); Plot(C,"C",1, 64);
Plot(IIf(x>xa,ya,-1e10) ,"Bottom",colorBrow n, 1+8); Plot(IIf(x>xb,yb,-1e10) ,"Top",colorBrown, 1+8);
xab = IIf(xb>xa,xb,xa); //Retracements Plot(IIf(x>=xab+1,RT23_ 6,-1e10),"23, 6% Retr.",5,1); Plot(IIf(x>=xab+1,RT38_ 2,-1e10),"38, 2% Retr.",5,1); Plot(IIf(x>=xab+1,RT50_ 0,-1e10),"50, 0% Retr.",colorBlue, 1) ; Plot(IIf(x>=xab+1,RT61_ 8,-1e10),"61, 8% Retr.",colorYellow, 1); Plot(IIf(x>=xab+1,RT78_ 6,-1e10),"78, 6% Retr.",colorYellow, 1);
Plot(Gauss2ord( C,5),"M5",4, 1);
Title = Name()+" per = "+WriteVal(per, 1.0) +" Close = "+WriteVal(C, 1.2)+ " ("+WriteVal( ROC( C,1),1.2) +"%)"+" Current Correction = "+WriteVal(RT, 1.0)+"%"; _SECTION_END( );
//////////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// ///////// /////
I amlooking at some Fibonacci code written by Thomas Zmuck in 2002.
File name is "INX - NASDAQ Fibonacci" .... ( I think that is the original name, but not sure)
It seems to use some functions that are not part of AB. Anyone familiar with what is needed to run the code?
-- Best Regards,
pondy
-- Best Regards,
pondy
|