# Account variables reference

> All 13 account variables in AlgoBarsX, each with its parameters, defaults, ranges and an example: account.balance, account.equity, account.margin, account.free_margin, account.margin_level, account.currency, account.leverage, account.mode, account.venue, positions and 3 more.

Source: https://algobarsx.com/docs/ref-var-account/

### `account.balance` → money

Account balance.

```algobarsx
bal = account.balance
```

Works in: strategy, indicator, alert. Since 1.0.

### `account.equity` → money

Balance plus open profit and loss.

```algobarsx
eq = account.equity
```

Works in: strategy, indicator, alert. Since 1.0.

### `account.margin` → money

Margin in use.

```algobarsx
used = account.margin
```

Works in: strategy, indicator, alert. Since 1.0.

### `account.free_margin` → money

Margin available.

```algobarsx
available = account.free_margin
```

Works in: strategy, indicator, alert. Since 1.0.

### `account.margin_level` → percent

Equity as a percentage of margin.

```algobarsx
level = account.margin_level
```

Works in: strategy, indicator, alert. Since 1.0.

### `account.currency` → string

Account currency.

```algobarsx
ccy = account.currency
```

Works in: strategy, indicator, alert. Since 1.0.

### `account.leverage` → number

Account leverage.

```algobarsx
lev = account.leverage
```

Works in: strategy, indicator, alert. Since 1.0.

### `account.mode` → string

demo or live.

```algobarsx
is_live = account.mode == "live"
```

Works in: strategy, indicator, alert. Since 1.0.

### `account.venue` → string

house, metatrader, ibkr or a broker name.

```algobarsx
where = account.venue
```

Works in: strategy, indicator, alert. Since 1.0.

### `positions` → list<Trade>

Open positions on the account, filterable by symbol, side and source.

```algobarsx
open_count = positions.len
```

Works in: strategy, indicator, alert. Since 1.0.

### `orders` → Orders

Pending orders on the account.

```algobarsx
waiting = orders.pending(tag: "grid")
```

Works in: strategy, indicator, alert. Since 1.0.

### `trades` → Trades

The strategy's own trades: open(), closed(), last().

```algobarsx
mine = trades.open()
```

Works in: strategy. Since 1.0.

### `history` → History

Closed trades with aggregates such as pnl, win_rate and profit_factor.

```algobarsx
today_pnl = history.today.pnl
```

Works in: strategy, indicator, alert. Since 1.0.
