Supported for-in empty array slice result negative body history

Category: market_structure

This script is a technical test case designed to validate Pine Script's behavior when a 'for-in' loop iterates over an empty array slice. It specifically checks the return value of the loop and its usage as a historical series index.

Formula

\text{source} = [0, 0] \\ \text{values} = \text{slice}(\text{source}, 1, 1) = [] \\ \text{length} = (\text{for } v \in \text{values} \rightarrow -1) = \text{na} \\ \text{result} = \text{close}[\text{na}]

See signal primitives and every published strategy that uses Supported for-in empty array slice result negative body history on WOBR StrategyVerse.


Open the interactive page on WOBR AI → · WOBR.AI home