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

Corrected Metastock Coding Question



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(C,10,S);
a2:=mov(C,20,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(C,10,S);
a2:=mov(C,20,S);
If(a1>a2,a3:=a1-a2,a3:=0);

which does not work.

Thanks in advance for your help.