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

[EquisMetaStock Group] Re: Little help Please...



PureBytes Links

Trading Reference Links

Using Ron's suggestion for a daily cross and a weekly MACD/EMA from a 
post that Roy made a few weeks ago which I found by looking in our 
archives, here is your answer:

{Weekly MACD - Close} {for daily charts}
Ld:=Input("Current week last day, 4=Thusday, 5=Friday",4,5,5);
{Set to 4 when no Friday data available}
P1:=Input("Weeks for Short EMA",1,99,13);
P2:=Input("Weeks for Long EMA",1,99,26);
P3:=Input("Weeks for Signal Line",1,99,9);
P1:=2/(P1+1); P2:=2/(P2+1); P3:=2/(P3+1);
Q:=Input("Updated on, 1=Dynamic, 2=Friday, 3=Monday,",1,3,2);
{1=current week is dynamic, (MS compatible)}
{2=update @ end of week except when no Friday}
{3=update @ start of new week}
Lb:=LastValue(Cum(1)-0)=Cum(1);
W1:=If(Ld=4 AND Lb AND DayOfWeek()=4,1,DayOfWeek()=5);
W2:=DayOfWeek()<=Ref(DayOfWeek(),-1);
We:=If(W1,1,If(Alert(W1,2)=0 AND W2,2,0));
Cl:=ValueWhen(1,We>0,If(We=1,C,Ref(C,-1)));
Ma:=If(Cum(We>0)=1,Cl,ValueWhen(1,We>0,PREV)*(1-P1)+Cl*P1);
Ma:=If(Q=1 AND We=0 AND Lb,ValueWhen(1,We>0,Ma) *(1-P1)+C*P1,Ma);
Ma:=If(DayOfWeek()=5 AND Q=3,Ref(Ma,-1),Ma);
Mb:=If(Cum(We>0)=1,Cl,ValueWhen(1,We>0,PREV)*(1-P2)+Cl*P2);
Mb:=If(Q=1 AND We=0 AND Lb,ValueWhen(1,We>0,Mb) *(1-P2)+C*P2,Mb);
Mb:=If(DayOfWeek()=5 AND Q=3,Ref(Mb,-1),Mb);
Md:=(Ma-Mb);
Sg:=If(Cum(We>0)=1,Md,ValueWhen(1,We>0,PREV)*(1-P3)+Md*P3);
Sg:=If(Q=1 AND We=0 AND Lb,ValueWhen(1,We>0,Sg) *(1-P3)+Md*P3,Sg);
Sg:=If(DayOfWeek()=5 AND Q=3,Ref(Sg,-1),Sg);
{Md;} {Sg;}

cross(ma,mb)
{end}

Filtering further you could change the last line to reflect a true 
condition today and a false condition yesterday but this really 
serves no purpose since the indicator output is a positive one only 
on the day of the cross. It is understood that the condition did not 
occur the day before.


Preston

   

--- In equismetastock@xxxxxxxxxxxxxxx, "bigbadwolfusa" 
<bigbadwolfusa@xxxx> wrote:
> OOOps...I should also say that the 13 week E didnt cross the 26 
week 
> E yesterday but it did today


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs Online - Over 14,500 titles.
No Late Fees & Free Shipping.
Try Netflix for FREE!
http://us.click.yahoo.com/JYdFFC/XP.FAA/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/