BALANCE
Your account balance, in your account currency. It changes when a position closes, not while one is open.
declare const BALANCE: number;In a backtest it starts at the balance you set and moves with the backtest’s closed positions.
Example
Section titled “Example”function onIntervalClose() { if (BALANCE < 500) { error("Balance below 500: stopping"); }}