PureBytes Links
Trading Reference Links
|
Hi Harry
This will work as long as Perx is a "constant" variable. By that I mean that it does not vary at
different points across the chart. Surrounding, shall we say, a "fixed" variable with LastValue()
converts it to a constant as far as MetaStock is concerned. I'm not sure that the Int() function is
necessary, but either that or Floor() should ensure that you eliminate any fractions.
Perx:=LastValue(Int((Period/4)));
If your variable, Perx, really is variable then you may need to resort to LastValue(Perx+PREV-PREV)
Kind regards
Roy
www.metastocktips.co.nz
----- Original Message -----
From: "bex1210" <hmw3@xxxxxxxxxxxxxx>
To: <equismetastock@xxxxxxxxxxxxxxx>
Sent: Friday, February 18, 2005 1:50 PM
Subject: [EquisMetaStock Group] Interger and Reference functions
>
>
> I have MS 8.01, EOD. I am getting an error with a formula that I don't
> understand, and thought someone might be able to put me on the correct
> path.
>
> Lets say that I have a formula which looks like this:
>
> Period:=Input("Periods",2,1000,100);
> Perx:=(Period/4);
> Price1:=Ref(C,-3*Perx)-Ref(C,-Period);
> etc, etc
>
> This works just fine in MS. However, since "Perx" may not be a whole
> number, I tried to substitute the following for line 2, above.
> Perx:=Int(Period/4);
>
> When I do this, MS will not accept the formula. The cursor stops just
> after "Ref(C, " , and the error message says that "This variable or
> expression must contain only constant data".
>
> Clearly "Perx" is a variable no matter whether it contains Int() or
> not. What am I missing here, and how can I assure that "Perx" is
> always a whole number?
>
> I also substituted ValueWhen () for Ref (), but got the same error
> message.
>
> Thanks for your help,
>
> Harry
>
>
>
>
>
>
>
>
> --------------------------------------------------------------------------------
> Yahoo! Groups Links
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/equismetastock/
>
> b.. To unsubscribe from this group, send an email to:
> equismetastock-unsubscribe@xxxxxxxxxxxxxxx
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/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/
|