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

[EquisMetaStock Group] Re: Question about moving average



PureBytes Links

Trading Reference Links

Rodolfo, try this event SMA indicator:

===========
SMA - event
===========
---8<--------------------------

{ Event SMA v1.0
  http://www.metastocktools.com }

{ Indicator user inputs }
pds:=Input("SMA periods",1,2520,21);
plot:=Input("plot SMA values:   [1]All,   [2]Only at event",1,2,2);

{ Event }
event:=C<Ref(C,-1);

{ Data array / formula }
forml:=If(event,100*(C-Ref(C,-1))/Ref(C,-1),0);

{ Event SMA }
sma:=Sum(forml,pds)/Sum(event,pds);
eventSma:=ValueWhen(1,event,sma);

{ Plot in own window }
forml;If(plot=1,sma,eventSma)

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


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




--- In equismetastock@xxxxxxxxxxxxxxx, "Rodolfo Sikora" <sikora@xxx> 
wrote:
>
> Hi,
> 
> Is there any tip to create a conditional MOV discarding,
> for example, 0 values.
> 
> Right now I have this formula:
> If(C < Ref(C,-1),100*(C-Ref(C,-1))/(Ref(C,-1)),0);
> 
> Basicaly it plots the % of the bearish days.
> I'm trying to reach a MOV of these %, but I'd like to ignore all 0
> (bullish days) without compromising the MOV.
> 
> Does it make sense? Any suggestion?
> 
> Thanks







 
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/