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

[EquisMetaStock Group] Re: Day of Week Function? performance for the specified day of the week.



PureBytes Links

Trading Reference Links

>From http://www.metastocktools.com/#metastock :


This indicator measures individual weekday performance (from today's
Close to the previous Close), either as an average % or cumulative %.

This statistical tool is very useful to determine micro-seasonal
tendencies in any market.

Example statistics for the Dow Jones index (1997-2007):

Day    Avg   Cumulative
-----------------------
Mon:  +0.1%   +45.2%
Tue:  +0.06%  +32.1%
Wed:  +0.04%  +19.0%
Thu:  +0.0%   + 0.1%
Fri:  -0.03%  -15.8%
All:  +0.03%  +80.5%


Related material:
Rev2 kit - Reversal Pattern finder v2.0
http://www.metastocktools.com/Rev2/Rev2.htm



MetaStock -> Tools -> Indicator Builder -> New ->
-> copy & paste complete formula between "---8<---" lines.

=====================
Weekday performance %
=====================
---8<--------------------------------------

{ Weekday Average/Cumulative performance %.

 Copyright © 2007 Jose Silva.
 The grant of this license is for personal use
  only - no resale or repackaging allowed.
 All code remains the property of Jose Silva.
 http://www.metastocktools.com }

{ Indicator inputs }
day:=Input("Select Day of Week: [Mon-Sun = 1-7, All = 0]",0,7,1);
type:=Input("Performance type:  [1]Avg for Day,  [2]Cummulative",1,2,1);

{ Daily performance % }
pf:=(C/Ref(C,-1)-1)*100;

{ Monday's performance % }
Mon:=DayOfWeek()=1;
tot:=Cum(pf*Mon);
Mon:=If(type=1,tot/Max(Cum(Mon),1),Tot);

{ Tuesday }
Tue:=DayOfWeek()=2;
tot:=Cum(pf*Tue);
Tue:=If(type=1,tot/Max(Cum(Tue),1),Tot);

{ Wednesday }
Wed:=DayOfWeek()=3;
tot:=Cum(pf*Wed);
Wed:=If(type=1,tot/Max(Cum(Wed),1),Tot);

{ Thursday }
Thu:=DayOfWeek()=4;
tot:=Cum(pf*Thu);
Thu:=If(type=1,tot/Max(Cum(Thu),1),Tot);

{ Friday }
Fri:=DayOfWeek()=5;
tot:=Cum(pf*Fri);
Fri:=If(type=1,tot/Max(Cum(Fri),1),Tot);

{ Saturday }
Sat:=DayOfWeek()=6;
tot:=Cum(pf*Sat);
Sat:=If(type=1,tot/Max(Cum(Sat),1),Tot);

{ Sunday }
Sun:=DayOfWeek()=7;
tot:=Cum(pf*Sun);
Sun:=If(type=1,tot/Max(Cum(Sun),1),Tot);

{ All weekdays }
tot:=Cum(pf);
all:=If(type=1,tot/Cum(1),Tot);

{ Plot in own window }
If(day=1,Mon,
If(day=2,Tue,
If(day=3,Wed,
If(day=4,Thu,
If(day=5,Fri,
If(day=6,Sat,
If(day=7,Sun,
all)))))))

---8<--------------------------------------


jose '-)
http://www.metastocktools.com





--- In equismetastock@xxxxxxxxxxxxxxx, "really_4real" <really_4real@xxx> 
wrote:
>
> 
> I'm trying to create an indicator which can show me performance based
> on  a selected day of the week.  Performance should be relative to the
> previous days close.  Ex: Selecting Monday, will return the %
> gain\loss from Friday's close to Monday close.  
> 
> I went through the formula primer and could not find any example to
> help me on the way.  If anyone can provide me with a the formula or
> related it would be greatly appreciated or point me in the right
> direction.
> 
> Thanks in advance
> Frank





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/