PureBytes Links
Trading Reference Links
|
mwtang, Dusant
> mwtang
>
> Roy has done some excellent work on weekly plots on daily charts and
> stuff like that.
> Do an archive search and you'll find the code.
> You can modify the code to suit your personal requirements.
> All the best.
> Dusant
Speaking of which, here's a commented functional version of a weekly MACD
for daily charts. This should serve as a useful model for other time frames.
Have fun.
Roy
{Weekly MACD - Close (Commented)}
{© 2003 Roy Larsen}
{rlarsen@xxxxxxxxxxxxxx}
{use on daily charts}
D:=Input("Signal Periods (in Weeks)",1,19,9);
Q:=Input("1=Update at Friday bar, Dynamic Current Week",0,0,0);
Q:=Input("2=Update at Friday bar, 3=Update at Monday bar",1,3,2);
{1=dynamic current week, MS compatible}
{2=update @ end of week except when no Friday}
{3=update @ start of new week}
A:=DayOfWeek()=5;
{normal Friday end of week}
B:=DayOfWeek()<=Ref(DayOfWeek(),-1);
{missed Friday end of week}
F:=LastValue(Cum(1))=Cum(1);
{last bar of chart - pseudo Friday?}
X:=0.15; Y:=0.075; D:=2/(D+1);
{3 EMA ratios}
J:=If(A,1,If(Alert(A,2)=0 AND B,2,0));
{end of week, 1 for Friday or 2 for Monday}
J:=If(F AND J=0 AND Q=1,1,J);
{last bar as Friday for dynamic current week}
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2,1,C)));
{if end-of-week signal use CLOSE for Friday or
previous CLOSE for Monday}
M:=If(Cum(J>0)=1,K,ValueWhen(1,J,PREV)*(1-X)+K*X);
{nominal 12 week EMA}
M:=If(A AND Q=3,ValueWhen(2,1,M),M);
{delay Friday signals if option selected}
N:=If(Cum(J>0)=1,K,ValueWhen(1,J,PREV)*(1-Y)+K*Y);
{nominal 26 week EMA}
N:=If(A AND Q=3,ValueWhen(2,1,N),N);
{delay Friday signals if option selected}
R:=M-N;
{difference between two EMA's - MACD}
Z:=If(Cum(J>0)=1,R,ValueWhen(1,J,PREV)*(1-D)+R*D);
{MACD signal line}
R; {MACD}
If(J>0,R,0); {pseudo MACD histogram plot}
Z; {signal}
> --- In equismetastock@xxxxxxxxxxxxxxx, mwtang <mwtang@xxxx> wrote:
> > Hallo! I would like to have some help.
> >
> > It is very usefull to have a weekly indicator (like macd histogram)
> to be incorporated in a daily chart. As I am still not good in
> writing formula in computer language for Metastock, I have the
> following questions to ask for help
> > .
> > 1. Can anyone modify the weekly macd histogram to be an hourly
> histogram (because I am doing intraday trading research) ?
> >
> > 2. What are the steps to take for me to plot the hourly histogram
> in a 15-minute chart (instead of plotting the weekly histogram in a
> daily chart) and have it presented as ribbon at the bottom of the chart ?
> >
> > 3. What should I do to have the whole set-up be included in '
> Expert' ?
> >
> > Hope some one can assist me. Thanks.
>
>
>
>
> 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/
>
>
>
>
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/BefplB/TM
---------------------------------------------------------------------~->
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/
|