How Can We Help?

BLOCKREF Function

You are here:
< All Topics

**Syntax updated in version 1.1**

Similar to the CondRef function but with second condition to reset the value without waiting for the first condition to be true.

Syntax:
BLOCKREF(locked value if Condition 1=True, Condition1, new value if Condition 2=True, Condition2)

Example: If Buy is true, BuyAmount will be equal to value of close at that bar. The value is kept even Buy is no longer true. Value will be only reset by second condition or when first condition will be evaluated to true again. When Sell is True, BuyAmount will be equal to zero.

Set BuyAmount = BLOCKREF(Close,Buy,0,Sell)

–Close––Condition 1––Condition 2––Blockref Value–
25TrueFalse25
28TrueFalse25
26.5TrueFalse25
30FalseTrue0
28.5FalseFalse0
31TrueFalse31
32.5TrueFalse31
Table of Contents