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

RE: [amibroker] Pivot Points



PureBytes Links

Trading Reference Links

You'll have to use the DayOfWeek function.

DayOfWeek() == 5 on Friday which would translate too this assuming the
code otherwise works:

 

EndOfWeek = DayOfWeek() == 5; //New line of code defining the end of the
week

Hi1 = IIf(EndOfWeek, Ref(HighestSince(EndOfWeek),H,1), 0);

 

You can translate the rest of the code the same way.

--

Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of amon_gizeh
Sent: Saturday, November 04, 2006 11:04
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Pivot Points

 

Hi.
I take the code below from AFL Library. How can I change month with
week?

SetChartOptions(1,chartShowDates);

Hi1 =
IIf(Month()!=Ref(Month(),-1),Ref(HighestSince(Month()!=Ref(Month(),-1),H
,1),-1),0);
Hi = ValueWhen(Month()!=Ref(Month(),-1),Hi1,1);
Lo1 = IIf(Month()!=Ref(Month(),-1),Ref(LowestSince( Month()!=Ref
(Month(),-1), L,1),-1),0);
Lo = ValueWhen(Month()!=Ref(Month(),-1),Lo1,1);
CL1=IIf(Month()!=Ref(Month(),-1),Ref(C,-1),0);
CL = ValueWhen(Month()!=Ref(Month(),-1),CL1,1);
rg = Hi - Lo;
bp = (Hi+Lo+CL)/3;
R1 = (2*bP) - Lo ;
S1 = (2*bP) - Hi;
R2 = bP + rg;
S2 = bP - rg;

Plot(C,"Close",colorBlack,styleCandle);
Plot(bp,"Pivot",colorRed,styleBar);
Plot(R1,"R1",colorBlue,styleBar);
Plot(S1,"S1",colorBlue,styleBar);
Plot(R2,"R2",colorBlue,styleBar);
Plot(S2,"S2",colorBlue,styleBar);

 


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006