How Can We Help?

IF Function

You are here:
< All Topics

IF(Condition, True value, False value) 

The conditional “IF” function allows you to design complex Boolean logic filters. If you paste the following script into the Script area in your trading software application, you will see a column of numbers that oscillate between 1 and -1, depending on when the closing price is greater than the opening price: 

SET A = IF(CLOSE > OPEN, 1, -1) 

The first argument of the “IF” function is a logical test. If close > open, the output value would be 1.

If it’s false, meaning close is not more than the open, the output value would be -1.

Table of Contents