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

Re: [EquisMetaStock Group] Improve Moving Average



PureBytes Links

Trading Reference Links




Bellamy,
When you click ok, the cursor will stop at the 
error point.
That will identify which variable is giving the 
error.
Try to "fix" that variable by the valuewhen() or 
lastvalue() method.
DusantChief Architect<A 
href="">http://www.candlestrength.com/
 
----- Original Message ----- 
From: <<A 
href=""><FONT face=Verdana 
size=2>bellamy_29m@xxxxxxxxx<FONT face=Verdana 
size=2>>
To: <<A 
href=""><FONT face=Verdana 
size=2>equismetastock@xxxxxxxxxxxxxxx<FONT face=Verdana 
size=2>>
Sent: Sunday, April 11, 2004 17:15 
PM
Subject: [EquisMetaStock Group] Improve Moving 
Average
<FONT face=Verdana 
size=2>> I am trying to write a MS6.52 formula to handle the situation where 
> there are less data points available than a nominated moving average 
> period, so I want the MA to show for the available data points until 
> there enough data points for the MA to operate normally. (Easily done 
> in VB, VBA, C, C++, just not MS!)> > Not knowing exactly 
how to get around MS lack of flexibility, I was > trying:> 
> prd:=Input("MA Periods...",1,100,5);> x:=Input("1-Open 2-High 
3-Low 4-Close 5-Volume 6-P",1,6,4);> 
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C)))));> 
ma:=If(Cum(1)<prd,Sum(x,Cum(1))/Cum(1),Mov(x,prd,S));> ma;> 
> which didn't work, with the error message "This variable or > 
expression must contain only constant data"> > ... so I then tried 
to set the prd value using code:> > prd:=Input("MA 
Periods...",1,100,5);> prd:=If(Cum(1)<prd,Cum(1),prd);> 
x:=Input("1-Open 2-High 3-Low 4-Close 5-Volume 6-P",1,6,4);> 
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C)))));> 
ma:=Mov(x,prd,S);> ma;> > which didn't work either, with 
the same error message "This variable > or expression must contain only 
constant data"> > Hopefully, someone can see what I am trying to 
achieve and will be > able to help.  Any assistance would be greatly 
appreciated.> > > >  > Yahoo! Groups 
Links> > <*> To visit your group on the web, go to:> 
     <A 
href=""><FONT face=Verdana 
size=2>http://groups.yahoo.com/group/equismetastock/<FONT 
face=Verdana size=2>> > <*> To unsubscribe from this group, send 
an email to:>      <A 
href=""><FONT face=Verdana 
size=2>equismetastock-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/equismetastock/ 
To unsubscribe from this group, send an email to:equismetastock-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.