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

Re: [Metastockusers] Re: How to code a trendline in MS



PureBytes Links

Trading Reference Links




Benjamin,
A moving average is already smoothed. If you wish 
to smoothen it further, use the Wilders() function or double smooth it like 
mov(mov(c, 3, e,), 5, s).
Just an idea.
DusantChief Architect<A 
href="">http://www.candlestrength.com/
 
----- Original Message ----- 
From: "Benjamin Moore" <<A 
href=""><FONT face=Verdana 
size=2>bfmoore3@xxxxxxxxxxxxxxx<FONT face=Verdana 
size=2>>
To: <<A 
href=""><FONT face=Verdana 
size=2>Metastockusers@xxxxxxxxxxxxxxx<FONT face=Verdana 
size=2>>
Sent: Wednesday, March 24, 2004 07:49 
AM
Subject: Re: [Metastockusers] Re: How to code a 
trendline in MS
<FONT face=Verdana 
size=2>> Any help please.> > I am trying to plot a smoothed 
moving average.  I have this setting in> several other programs, but 
in Metastock I do not have this option.  I am> trying to provide a 
smoothed moving average on the price oscillator.> > I appreciate 
everyone's efforts on this site.  How nice not to read about> ... 
well we all know what hits our emails these days.> > 
Thanks> > Benjamin> > ----- Original Message 
-----> From: "Jose" <<A 
href=""><FONT face=Verdana 
size=2>josesilva22@xxxxxxxxx>> 
To: <<FONT 
face=Verdana size=2>Metastockusers@xxxxxxxxxxxxxxx<FONT face=Verdana 
size=2>>> Sent: Tuesday, March 16, 2004 12:22 PM> Subject: 
[Metastockusers] Re: How to code a trendline in MS> > > 
> By tweaking the MS code below, you can plot just about any 
trendline> imaginable.> > ============> 2-point 
plot> ============> ---8<---------------------------> 
> { 2-point plot, coding example v2.5 }> { Trendline choice 1: 
last High/Low in month }> { Trendline choice 2: lows at Jan/June 2004 
}> { ©Copyright 2003-2004 Jose Silva }> { <A 
href=""><FONT face=Verdana 
size=2>http://users.bigpond.com/prominex/pegasus.htm<FONT 
face=Verdana size=2> }> > plot:=Input("choose event trend 
[1~2]",1,2,1);> choose:=Input("plot: trendline [1],  event points 
[2]",1,2,1);> > {define events}> 
time1:=C=HHV(C,21);> time2:=C=LLV(C,21);> time2:=time2 AND 
time2<>time1;> > {alternative events}> 
dateA:=Year()=2004 AND Month()=1;> 
dateA:=If(LastValue(Cum(dateA))=0,> 
 Year()=LastValue(Year())-1>  AND 
Month()=LastValue(Month()),dateA);> 
LoValA:=Lowest(ValueWhen(1,dateA,L));> timeA:=dateA AND 
L=LastValue(LoValA);> > dateB:=Year()=2004 AND Month()=6;> 
dateB:=If(LastValue(Cum(dateB))=0,> 
 Year()=LastValue(Year())>  AND 
Month()=LastValue(Month()),dateB);> 
LoValB:=Lowest(ValueWhen(1,dateB,L));> timeB:=dateB AND 
L=LastValue(LoValB);> timeB:=timeB AND timeB<>timeA;> 
> {choose events}> time1:=If(plot=1,time1,timeA);> 
time2:=If(plot=1,time2,timeB);> price1:=If(plot=1,C,L);> 
price2:=If(plot=1,C,L);> > {restrict to last events}> 
time1:=time1>  AND Cum(time1)=LastValue(Cum(time1));> 
time2:=time2>  AND Cum(time2)=LastValue(Cum(time2));> 
> {sort events}> t1pds:=LastValue(BarsSince(time1));> 
t2pds:=LastValue(BarsSince(time2));> 
x1:=If(t1pds>=t2pds,time1,time2);> 
x2:=If(t1pds>=t2pds,time2,time1);> 
y1:=If(t1pds>=t2pds,price1,price2);> 
y2:=If(t1pds>=t2pds,price2,price1);> > {fix 
coordinates}> y1:=ValueWhen(1,x1,y1);> 
y2:=LastValue(ValueWhen(1,x2,y2));> b1:=LastValue(BarsSince(x1));> 
b2:=LastValue(BarsSince(x2));> > {trendline definition}> 
plot:=y1+BarsSince(x1)*(y2-y1)/(b1-b2+.000001);> 
plot:=Ref(Ref(plot,-b2),b2);{rem to extend plot}> > 
If(choose=1,plot,time1+time2)> > 
---8<---------------------------> > jose '-)> > 
> > --- In <A 
href=""><FONT face=Verdana 
size=2>Metastockusers@xxxxxxxxxxxxxxx, 
karile <<FONT face=Verdana 
size=2>karile@x...> wrote:> 
>> > Hi all,> >> > I would like to know if 
someone would be able to write> > the formula of a trendline in MS 
?> >> > Thanks in advance for your help,> 
>> > Karile> > > > > > 
> Yahoo! Groups Links> > > > > 
> > >  > Yahoo! Groups Links> > 
<*> To visit your group on the web, go to:> 
     <A 
href=""><FONT face=Verdana 
size=2>http://groups.yahoo.com/group/Metastockusers/<FONT 
face=Verdana size=2>> > <*> To unsubscribe from this group, send 
an email to:>      <A 
href=""><FONT face=Verdana 
size=2>Metastockusers-unsubscribe@xxxxxxxxxxxxxxx<FONT 
face=Verdana size=2>> > <*> Your use of Yahoo! Groups is subject 
to:>      <A 
href=""><FONT face=Verdana 
size=2>http://docs.yahoo.com/info/terms/<FONT face=Verdana 
size=2>>  > > 







Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/Metastockusers/ 
To unsubscribe from this group, send an email to:Metastockusers-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.