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

[EquisMetaStock Group] Re: Changing Moving Average Color



PureBytes Links

Trading Reference Links

One way is to create two indicators, each of the same moving average.
 Something like

nn := Input("Moving average length",1,9999,20);
xx := Mov(C,nn,S);

Now you need to know if this is going up or down, so add

yy := xx-Ref(xx,-1);

And only plot it when it is going up, so

xx*(yy>0);

This is one part of it, which you can make green.  The other part is
the same, just change the last line to

xx*(yy<=0)

and plot it in red.  Now you have two plots of the same moving
average. A bit messy, but will do the trick. In this case, the
indicator drops to zero when you don't want to follow it anymore. You
could also let it drop to the most recent value e.g. when it was still
used, something like

xx*(yy>0)+valuewhen(1,yy>0,c)*(yy<=0)

will do the trick for the rising and

xx*(yy<=0)+valuewhen(1,yy<=0,c)*(yy>0)

for the falling

Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com

--- In equismetastock@xxxxxxxxxxxxxxx, "terenstra" <terenstra@xxxx> wrote:
> 
> Dear Metastock users,
> 
> I am using Metastock 6.52 for years with satisfaction.
> 
> But, I have a question regarding moving average.
> 
> I'd like to see in an uptrend a green moving average ( sma 20 ) and a 
> red one in a falling moving average ( sma 20 )is this possible ? and 
> how I am doing that ?.
> 
> Thanks in advance.
> 
> George Terenstra
> De lage Landen
> Nederland




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