IFF (Function)

image\trumpet2.gif Disclaimer

The IFF function is used to conditionally return one of two specified numeric values.

Syntax

IFF(Test, TrueVal, FalseVal)

Returns (Double)

The numeric value of TrueVal if Test is true and the numeric value of FalseVal if Test is false.

Parameters

Test

Specifies a conditional expression to check (such as Close > Open).

TrueVal

Sets a numeric value to return if Test expression is true.

FalseVal

Sets a numeric value to return if Test expression is false.

Remarks

By using the IFF function, you are able to evaluate one or more conditions in the Test input expression, returning one numeric value if Test is true, and returning another numeric value if Test is false.

Example

Assigns to Value1 the number 1 if Close>Open is true or the number -1 if Close>Open is false.

Value1  = IFF(Close>Open,1,-1);

Reference

The IFF function was developed by TradeStation Technologies, Inc.