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

[amibroker] Pivot Points



PureBytes Links

Trading Reference Links

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