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

[EquisMetaStock Group] Re: a new volume-adjusted MA



PureBytes Links

Trading Reference Links


Ok, this is what I have so far:

======================
EMA - Volume adaptable
======================
---8<-----------------

{ Volume adaptable EMA v1.0 }
{ EMA samples bars with above-avg Volume }
{ ©Copyright 2004 Jose Silva }
{ For personal use only }
{ http://users.bigpond.com/prominex/pegasus.htm#metastock }

{ User inputs }
pds:=Input("EMA periods",1,2520,21);
x:=Input("use Open=1 High=2 Low=3 Close=4 WClose=5 P=6",1,6,4);
shift:=Input("EMA vertical shift %",
 -100,100,0)/100+1;
plot:=Input("[1]EMA,  [2]Data,  [3]Sampling bars, [4]Crossovers",1,4,
1);

{ Select price field }
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),If(x=6,P,C)))));

{ Above average Volume points }
VolAvgPlus:=V>Mov(V,pds,E);

{ Select above-avg bars for EMA }
x:=ValueWhen(1,VolAvgPlus,x);

{ Reduce periodicity on low bar count }
pds:=If(pds>Cum(IsDefined(x)),
 Cum(IsDefined(x)),pds);

{ EMA }
Ema:=x*2/(pds+1)+PREV*(1-2/(pds+1));
Ema:=Ema*shift;

{ Crossover signals }
signals:=Cross(x,Ema)-Cross(Ema,x);

{ Plot on price chart }
If(plot=1,Ema,If(plot=2,x,
 If(plot=3,VolAvgPlus,signals)))

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


jose '-)


--- In equismetastock@xxxxxxxxxxxxxxx, "Jose" <josesilva22@xxxx> 
wrote:
> 
> This excellent post has given me an idea for coding a unique Moving 
> Avg:
> http://finance.groups.yahoo.com/group/equismetastock/message/15254
> 
> How about a MA that only considers data on those days when the
> volume is x-periods above the average?
> Any further ideas/suggestions before I begin coding it?
> 
> jose '-)





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/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/