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

[EquisMetaStock Group] Re: Number of MA cross overs



PureBytes Links

Trading Reference Links

I don't mind at all, Sparkie. :)
I actually encourage experimentation with MetaStock - that's one 
reason I try and code in a manner that can be understood by most.


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



--- In equismetastock@xxxxxxxxxxxxxxx, "sparkie1168" <sparkie68@xxx> 
wrote:
>
> Hi Jose
>
> The indicator works beautiful. Thanks for that.
> I added signal:=Cross(ma1,ma2) or Cross(ma2,ma1);
> So the indicator works out both up & down cross overs
> I hope you don't mind?
>
> Regards
>
> Sparkie
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "Jose Silva"
> <josesilva22@> wrote:
>
> Try this MS indicator:
>
> ---8<--------------------------
>
> { Signal count within date period.
>
>   For personal use only.
>   http://www.metastocktools.com }
>
> { Date inputs }
> StDay:=Input("start Day",1,31,1);
> StMnth:=Input("start Month",1,12,1);
> StYear:=Input("start Year",1800,2200,2005);
> EnDay:=Input("end Day",1,31,31);
> EnMnth:=Input("end Month",1,12,12);
> EnYear:=Input("end Year",1800,2200,2005);
>
> { Selected date period }
> start:=Year()>StYear
>  OR (Year()=StYear AND (Month()>StMnth
>  OR Month()=StMnth AND DayOfMonth()>=StDay));
> end:=Year()<EnYear
>  OR (Year()=EnYear AND (Month()<EnMnth
>  OR Month()=EnMnth AND DayOfMonth()<=EnDay));
> period:=
> start AND (end OR (start AND Alert(start=0,2)));
>
> { Signal - SMA crossover example }
> ma1:=Mov(C,5,S);
> ma2:=Mov(C,21,S);
> signal:=Cross(ma1,ma2);
>
> { Restrict signals to selected time period }
> signalRes:=signal*period;
>
> { Count signals }
> signalCount:=Cum(signalRes);
>
> { Plot in own window }
> signalCount
>
> ---8<--------------------------
>
>
> jose '-)
> http://www.metastocktools.com
>
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "sparkie1168" <sparkie68@>
> wrote:
>
> Hi All
>
> Does anybody know how to add the number of times 2 moving averages
> cross over in say a 12 month period??
>
> Regards
>
> Sparkie







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

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

<*> 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/