PDA

View Full Version : Using non-constant values into constants


wojtek
29th May 2005, 04:30 PM
Is there any way to convert the output of one Metastock function into a format acceptable as input of another function?
For example:
var1:=BarsSince(C=HHV(C,10));
var2:=Mov(C, var1, S);

This does not work because Metastock complains that var1 is not a constant. Is there any way around this?

Wojtek

PS. Using LastValue() would work but would not produce valid historical results because it only looks at the last value of the entire data array.

Jose
5th June 2005, 11:12 AM
Short reply from a tropical place with poor Net access (until Sept 2005): :P


var1:=BarsSince(C=HHV(C,10));
var1:=LastValue(var1+PREV-PREV);

var2:=Mov(C, var1, S);




jose

wojtek
19th June 2005, 12:31 AM
Thanks, Jose, but Metastock still complains that var1 is not a constant.

Wojtek

wojtek
19th June 2005, 12:36 AM
Ignore that last comment, Jose. I got it to work.
I did not realize that var1 (in the example) had to be redefined under the same name for this trick to work.
Many thanks

Wojtek