Support

Equilla Formula Language

Sign

Returns 1 for a positive number, -1 for a negative number, and 0 if the number is zero.

Inputs

Expression
Numeric: The expression to evaluate.

Examples

Display a value only if it is negative
Variable: change; change = NetPChg( Close, 1 ); If Sign( change ) = -1 Then DrawForest( change, 0, "Negative Change", "Zero" );
Apply the sign of one value to another value
Variable: theSign; theSign = Sign( Momentum( Close, 1 ) ); DrawLine( Close * theSign, "Direction Adjusted Close" );

See also:

Abs; Neg;