Hi
Not exactly sure if you are using an indicator or AAexplore or something else,
But
You can set a chart indicator to weekly timeframe or an AA to weekly in AA
settings then
yoursum=Sum(C,26);
If you must use daily timeframe then
yoursum= Sum(TimeFrameGetPrice("C",inWeekly,0),26));
Also you should note, Yahoo historical prices set to weekly will give you the
close for the first day in week (5 day weeks in Mon close-not sure about 4 day
weeks)- the is is for stocks, not sure about mutuals.
AB will give you the close for last day of week (5day=fri,4day=thurs).
Dan
--- In [email protected], "john10987654321" <john10987654...@...> wrote:
>
> I have a variable, WeeklySum, that I am running every Friday with Amiquote on
> Yahoo mutual fund data to get a sum of the past 26 weeks of closes. (I then
> divide by 26 to get an average.) However, some weeks only consist of four
> trading days and so my calculations are off when comparing my 5-day numbers
> to the actual weekly closes listed on Yahoo's historical quotes page. I am
> trying to figure out how to use dayofweek() to only get the Friday close. I
> understand that dayofweek() == 5 but do not know how to change my formula
> below to work with Friday data. Any help appreciated.
>
> WeeklySum = C + Ref( C, -5 ) + Ref( C, -10 ) + Ref( C, -15 ) + Ref( C, -20 )
> + Ref( C, -25 ) + Ref( C, -30 ) + Ref( C, -35 ) + Ref( C, -40 ) + Ref( C, -45
> ) + Ref( C, -50 ) + Ref( C, -55 ) + Ref( C, -60 ) + Ref( C, -65 ) + Ref( C,
> -70 ) + Ref( C, -75 ) + Ref( C, -80 ) + Ref( C, -85 ) + Ref( C, -90 ) + Ref(
> C, -95 ) + Ref( C, -100 ) + Ref( C, -105 ) + Ref( C, -110 ) + Ref( C, -115 )
> + Ref( C, -120 ) + Ref( C, -125 );
>