THEN is a crucial keyword in the ProBuilder language, primarily used within an IF statement to specify the block of code that should execute when the preceding condition is true. It acts as a bridge between the condition and the actions that should follow if the condition holds.
IF condition THEN
// Code to execute if condition is true
ENDIF
IF Close > Open THEN
DRAWARROWUP(barindex, low) COLOURED(0, 255, 0)
ENDIF
In this example, if the closing price of a bar is greater than its opening price, an upward green arrow is drawn at the low of the bar. This visual indicator can help in identifying potential bullish patterns.
IF statement.THEN must be paired with an ENDIF to properly close the conditional statement.This keyword is fundamental in creating conditional logic in ProBuilder scripts, allowing for dynamic and responsive indicator and trading strategy development.