# Functions

## Market Data

<table data-header-hidden data-full-width="true"><thead><tr><th width="342">Function</th><th>Description</th></tr></thead><tbody><tr><td><h3><a href="functions/ticker"><mark style="color:blue;"><code>ticker</code></mark></a></h3></td><td>The current market price of the latest traid on the market.</td></tr><tr><td><h3><a href="functions/orderbook"><mark style="color:blue;"><code>orderbook</code></mark></a></h3></td><td>Orderbook from the market in the <a href="structures/orderbook"><mark style="color:blue;">Orderbook</mark></a> structure.</td></tr><tr><td><h3><a href="functions/candles"><mark style="color:blue;"><code>candles</code></mark></a></h3></td><td>Market candlesticks in the <a href="structures/candle"><mark style="color:blue;">Candle</mark></a> structure.</td></tr><tr><td><h3><a href="functions/own"><mark style="color:blue;"><code>own</code></mark></a></h3></td><td>Self orders in the <a href="structures/orderbook"><mark style="color:blue;">Orderbook</mark></a> structure.</td></tr><tr><td><h3><a href="functions/vwap"><mark style="color:blue;"><code>vwap</code></mark></a></h3></td><td>Calculates the volume-weighted average.</td></tr><tr><td><h3><a href="functions/amount-before-price"><mark style="color:blue;"><code>amount_before_price</code></mark></a></h3></td><td>The amount of basic tokens up to a certain price.</td></tr><tr><td><h3><a href="functions/amount-threshold-index"><mark style="color:blue;"><code>amount_threshold_index</code></mark></a></h3></td><td></td></tr></tbody></table>

***

## Balances and Exchange info

<table data-header-hidden data-full-width="true"><thead><tr><th width="240">Function</th><th>Description</th></tr></thead><tbody><tr><td><h3><a href="functions/symbol"><mark style="color:blue;"><code>symbol</code></mark></a></h3></td><td>Exchange information in <a href="structures/symbol">Symbol</a> structure.</td></tr><tr><td><h3><a href="functions/balance"><mark style="color:blue;"><code>balance</code></mark></a></h3></td><td>Token balance of certain exchange in <a href="structures/balance">Balance</a> structure.</td></tr><tr><td><h3><a href="functions/saved-balance"><mark style="color:blue;"><code>saved_balance</code></mark></a></h3></td><td>Saved token balance of certain exchange in <a href="structures/balance">Balance</a> structure.</td></tr><tr><td><h3><a href="functions/group-balance"><mark style="color:blue;"><code>group_balance</code></mark></a></h3></td><td>The sum of the token balances from all exchanges in the group in <a href="structures/groupbalance">Group Balace</a> structure.</td></tr></tbody></table>

***

## Calculations

<table data-header-hidden data-full-width="true"><thead><tr><th width="252">Function</th><th>Description</th></tr></thead><tbody><tr><td><h3><a href="functions/mean"><mark style="color:blue;"><code>mean</code></mark></a></h3></td><td>Compute the arithmetic mean (average) of the given list elements.</td></tr><tr><td><h3><a href="functions/median"><mark style="color:blue;"><code>median</code></mark></a></h3></td><td>Compute the median of the given list elements.</td></tr><tr><td><h3><a href="functions/max"><mark style="color:blue;"><code>max</code></mark></a></h3></td><td>Returns max value of the given list elements.</td></tr><tr><td><h3><a href="functions/min"><mark style="color:blue;"><code>min</code></mark></a></h3></td><td>Returns min value of the given list elements.</td></tr><tr><td><h3><a href="functions/exp"><mark style="color:blue;"><code>exp</code></mark></a></h3></td><td>Calculates the exponent value.</td></tr><tr><td><h3><a href="functions/abs"><mark style="color:blue;"><code>abs</code></mark></a></h3></td><td>Returns the absolute value of the given number.</td></tr><tr><td><h3><a href="functions/logn"><mark style="color:blue;"><code>logn</code></mark></a></h3></td><td>Calculates the value of the natural logarithm.</td></tr><tr><td><h3><a href="functions/count"><mark style="color:blue;"><code>count</code></mark></a></h3></td><td>Returns the number of the given list elements.</td></tr><tr><td><h3><a href="functions/random"><mark style="color:blue;"><code>random</code></mark></a></h3></td><td>Random decimal value in range [0, 1].</td></tr><tr><td><h3><a href="functions/sum"><mark style="color:blue;"><code>sum</code></mark></a></h3></td><td>Sum of the given list elements.</td></tr></tbody></table>

***

## Other

<table data-header-hidden data-full-width="true"><thead><tr><th width="254">Function</th><th>Description</th></tr></thead><tbody><tr><td><h3><a href="functions/cached"><mark style="color:blue;"><code>cached</code></mark></a></h3></td><td>Used to cache the results of calculating the cached_value formula for the ttl time in seconds.</td></tr><tr><td><h3><a href="functions/remove-nan"><mark style="color:blue;"><code>remove_nan</code></mark></a></h3></td><td>Drop decimal(Nan) of the given list elements.</td></tr><tr><td><h3><a href="functions/is-nan"><mark style="color:blue;"><code>is_nan</code></mark></a></h3></td><td>True if input Nan and False if input not Nan.</td></tr><tr><td><h3><a href="functions/var"><mark style="color:blue;"><code>var</code></mark></a></h3></td><td></td></tr></tbody></table>
