PureBytes Links
Trading Reference Links
|
Keith,
This seems to be using the correct start and end for the week....How did
you come to your conclusion that it is not ?
weekstart = DayOfWeek() < Ref( DayOfWeek(), -1 );
weekend = DayOfWeek() > Ref( DayOfWeek(),1);
Plot(weekstart,"weekstart",colorRed,styleHistogram|styleOwnScale);
Plot(weekend,"Weekend",colorBlue,styleHistogram|styleOwnScale);
Anthony
----- Original Message -----
From: "Keith Newhouse" <knewhous@xxxxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, February 17, 2004 3:13 AM
Subject: [amibroker] Stochastic of Weekly array
> Hi Group,
>
> In Anthony Faragasso's Stochastic of Weekly array the code produces a
> week starting Friday and finishing Thursday. Not Monday to Friday
> which I assumed it would do.
>
> I am attempting to use this code to produce weekly Pivot Points with
> Resistance and Support on the daily chart. All worked quite well
> except the actual days of the week were incorrect.
>
> Does Anthony or anyone else know how I can overcome this problem.
>
> The code is as follows;
>
>
> //Support and Resistance levels
>
> weekstart = DayOfWeek() < Ref( DayOfWeek(), -1 );
> weekend = DayOfWeek() > Ref( DayOfWeek(),1);
> /**Establish Weekly Price arrays**/
> WeeklyOpen=ValueWhen(DayOfWeek()< Ref(DayOfWeek(),-1) ,Open);
> WeeklyHigh = ValueWhen( weekend, HighestSince( weekstart, High ) );
> WeeklyLow = ValueWhen( weekend, LowestSince( weekstart, Low ) );
> WeeklyClose=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1),Close);
> WeeklyVolume=ValueWhen(DayOfWeek() > Ref(DayOfWeek(),1),Sum(V,5));
>
> P=(WeeklyHigh+WeeklyLow+WeeklyClose)/3;
> R1=(P*2)-WeeklyLow;
> R2=P+WeeklyHigh-WeeklyLow;
> S1=(P*2)-WeeklyHigh;
> S2=P-WeeklyHigh+WeeklyLow;
>
> Plot(P,"P",colorBlack,styleLine);
> Plot(R1,"R1",colorIndigo,styleDots);
> Plot(R2,"R2",colorBlue,styleThick);
> Plot(S1,"S1",colorIndigo,styleDots);
> Plot(S2,"S2",colorRed,styleThick);
>
>
>
>
>
>
> 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
> Yahoo! Groups Links
>
>
>
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
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
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|