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

Re: [EquisMetaStock Group] Creating 50 EMA Above/Below Ratio



PureBytes Links

Trading Reference Links

Pablo and Bellamy,
Thank you much for the help with this code - I now am getting a chart
that is what I envisioned!  
Thanks again,
Mark

--- In equismetastock@xxxxxxxxxxxxxxx, "bellamy_29m" <bellamy_29m@xxx>
wrote:
>
> pumrysh,
> 
> There are a couple of small errors in your code:
> --8<----------
> lookback:=100;
> EMA:=Mov(C,50,E);
> DaysAbove:=Sum(If(C>EMA,1,0),lookback);
> DaysBelow:=Sum(If(C>EMA,1,0),lookback);
> {These are the same value!}
> 
> Ratio:=DaysAbove/DaysBelow;
> {prone to divide by zero errors}
> 
> Ratio;
> --8<----------
> 
> 
> As and alternative, try:
> 
> --8<----------
> lookback:=10;
> EMA:=Mov(C,50,E);
> DaysAbove:=Sum(C>EMA,lookback);
> DaysBelow:=Sum(C<EMA,lookback);
> Ratio:=DaysAbove/Max(DaysBelow,1);
> Ratio;
> --8<----------
> 
> 
> Cheers
>










------------------------ Yahoo! Groups Sponsor --------------------~--> 
Home is just a click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/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/