EndOfWeek = dayofweek()>ref(dayofweek(),1);
--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://www.aflwriting.com
What if Xmax and NY fall on Friday?
Terry wrote:
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: [EMAIL PROTECTED] ps.com [mailto:[EMAIL PROTECTED] ps.com] On Behalf Of amon_gizeh
Sent: Saturday, November 04, 2006 11:04
To: [EMAIL PROTECTED] ps.com
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);
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
| Investment management software | Investment property software | Investment software |
| Investment tracking software | Return on investment software |
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
