> 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/grids/how-a-grid-executes.md).

# How a grid executes

A grid uses its configuration to calculate and place orders while its bot is running. Its behavior depends on formulas, conditions, and timing parameters.

#### Starting a grid

Saving a grid stores its configuration. **Simulate** previews calculated orders without placing them.

For live trading, the grid must be enabled and the bot must be running. Order placement and order filling are separate events: the exchange determines whether and when a placed order fills.

#### Calculating orders

The grid evaluates `buy_orders_count` and `sell_orders_count` to determine the configured number of orders on each side.

For each order, it calculates:

* **`execute_price`:** the order price.
* **`execute_volume`:** the amount of the base asset.

Formulas can use `side` to distinguish buys from sells and `order_pos` to identify each level. Buy positions are negative (**−1, −2, −3…**); sell positions are positive (**1, 2, 3…**). [Order poss](https://docs.origami.tech/reference/grid-language/predefined-parameters/order-pos.md#order_pos-integer)

#### Placement and timing

Optional parameters control the order sequence and pauses:

| Parameter             | Purpose                                                       |
| --------------------- | ------------------------------------------------------------- |
| `time_between_orders` | Sets the delay between placing individual orders, in seconds. |
| `sleep_after_seconds` | Sets the pause after a grid execution cycle, in seconds.      |

For example, `time_between_orders = 1` spaces order placements one second apart, while `sleep_after_seconds = 60` adds a sixty-second pause after the cycle. These settings control placement timing, not how quickly orders fill.

#### Conditions and recalculation

Order counts can depend on conditions. For example:

`1 if rsi_m15 < 30 else 0`

This defines one buy order when the condition is true and zero when it is false.

Formulas that depend on market data can produce different values as that data changes. The documentation notes that changing `execute_volume` without `sleep_after_seconds` can cause immediate order replacement. Use timing controls when configuring frequently changing formulas.

#### Monitoring execution

Use **Active Orders** to inspect working orders and **Orders History** to review completed or canceled orders.

After changing settings or stopping a grid, check the actual order statuses in the Terminal. Simulation results describe calculated levels; live order records show what happened on the exchange.
