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

How Do I Code this in Metastock?



PureBytes Links

Trading Reference Links

I would like to use a conditional IF statement to assign an expression to a
variable.  I can calculate a value within the IF statement, but I need to
know how to set the value to a variable name.

Example:  This works

a1:=mov(10,C,S);
a2:=mov(20,C,S);
If(a1>a2,a1-a2,0);

but I would like to insert a variable, say "a3", into the IF statement,
something like this

a1:=mov(10,C,S);
a2:=mov(20,C,S);
If(a1>a2,a3:=a1-a2,a3:=0);

which does not work.

Thanks in advance for your help.