PureBytes Links
Trading Reference Links
|
Greg,
The last post had an unwanted line of code in it. Try this formula, this
uses up to current data.
/****************************************/
LastBar = Cum(1)==LastValue(Cum(1));
WeeklyOpen=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1)OR Lastbar ,Open);
Weeklyhigh=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1)OR Lastbar,High);
WeeklyLow=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1)OR Lastbar ,Low);
WeeklyClose=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1)OR
Lastbar,Close);
Weekly_avg=(WeeklyOpen+Weeklyhigh+WeeklyLow+WeeklyClose)/4;
Filter=Cross(weekly_avg, EMA (weekly_avg,40) );
AddColumn( weekly_avg, "weekly_avg" );
AddColumn( EMA (weekly_avg,40), "ema (weekly_avg,40)" );
Anthony
"Greg Q. Liu" wrote:
> I try to write an AFL fomula to scan weekly crossing for 4 week
> periods by using daily data
> as weekly_avg=(weekly_high+weekly_low+weekly_open+weekly_close)/4;filter=cross(weekly_avg,
> ema (weekly_avg,40) );addcolumn( weekly_avg, "weekly_avg" );addcolumn(
> ema (weekly_avg,40), "ema (weekly_avg,40)" ); But I only have daily
> data, how this can be done? Thanks. GL
>
>
> Yahoo! Groups Sponsor
ADVERTISEMENT
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|