> For the complete documentation index, see [llms.txt](https://docs.origami.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origami.tech/reference/grid-language/functions/random.md).

# random()

random() returns a random number between 0 and 1. Wrap it in cached() when using it in price or volume formulas.

Learn how to use the Random function in Origami Tech to generate random values for simulations, strategy testing, or stochastic model creation.

## `random`() -> *decimal*

returns random decimal value in range `[0, 1]`

{% hint style="warning" %}
Be careful using this function in execute\_price or execute\_volume. Usage without cached will lead to unstoppable recreate of the grid.
{% endhint %}
