once(bool Condition): int

Helper function; returns nonzero when the Condition parameter became true the first time in a session or backtest, otherwise 0.

Parameters:

Condition - any boolean expression.

Returns:

Nonzero when Condition just became true, otherwise 0.

Example:

if(once(!is(LOOKBACK))) printf("\nEnd of lookback reached!");

See also:

if, ifelse

► latest version online