> 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/function/required-parameters/execute-price.md).

# Execute Price

## <mark style="color:purple;">`execute_price`</mark> \[*decimal* | *formula* -> \[*decimal*]]

The price value for each order in the grid. It accepts both integer and decimal inputs and allows the use of formulas as values. If-else logic is supported. Use the [`buy`](/function/pre-defined-parameters/side.md) or [`sell`](/function/pre-defined-parameters/side.md) side to configure buy and sell orders within a single grid.

{% hint style="danger" %}
Always positive value. Can’t be zero.
{% endhint %}

{% hint style="info" %}
Supports the use of the iterable parameter [`order_pos`](/function/pre-defined-parameters/order-pos.md) to facilitate the placement of multiple orders.
{% endhint %}

{% hint style="danger" %}
[<mark style="color:blue;">`execute_volume`</mark>](/function/required-parameters/execute-volume.md) can't be used in <mark style="color:purple;">`execute_price`</mark> .
{% endhint %}

<details>

<summary>Example:</summary>

The order will be placed at a price of 2345.95.

<mark style="color:red;">`"execute_price": "2345.95"`</mark>

***

The order will be executed at the current market price.

<mark style="color:red;">`"execute_price": "`</mark>[<mark style="color:blue;">`ticker`</mark>](/function/functions/ticker.md)<mark style="color:red;">`()"`</mark>

```
ticker()
```

***

The order will be placed at the first market bid price.

<mark style="color:red;">`"execute_price": "`</mark>[<mark style="color:blue;">`orderbook`</mark>](/function/functions/orderbook.md)<mark style="color:red;">`().bid[0].price"`</mark>

```
orderbook().bid[0].price
```

***

The order will be executed at the first ask price.

<mark style="color:red;">`"execute_price": "`</mark> [<mark style="color:blue;">`orderbook`</mark>](/function/functions/orderbook.md)<mark style="color:red;">`().ask[0].price"`</mark>

```
orderbook().ask[0].price
```

***

The order will be placed at the arithmetic average of the bid and ask prices for Bybit's ETH-USDT pair.

<mark style="color:red;">`"execute_price": "(`</mark>[<mark style="color:blue;">`orderbook`</mark>](/function/functions/orderbook.md)<mark style="color:red;">`('ETH-USDT','bybit').bid[0].price +`</mark> [<mark style="color:blue;">`orderbook`</mark>](/function/functions/orderbook.md)<mark style="color:red;">`('EVER-USDT','bybit').ask[0].price) / 2"`</mark>

```
(orderbook('ETH-USDT','bybit').bid[0].price + orderbook('EVER-USDT','bybit').ask[0].price) / 2
```

***

The order will be executed at the current market price if the starting total base matches the current total base. Otherwise, it will be placed at the fair price, determined by the ratio of the differences between the starting and current balances of the base and counter tokens.

<mark style="color:red;">`"execute_price": "`</mark>[<mark style="color:blue;">`ticker`</mark>](/function/functions/ticker.md)<mark style="color:red;">`() if`</mark> [<mark style="color:blue;">`group_balance`</mark>](/function/functions/group-balance.md)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`base`</mark>](/function/shortcuts/base.md)<mark style="color:red;">`').current.total ==`</mark> [<mark style="color:blue;">`group_balance`</mark>](/function/functions/group-balance.md)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`base`</mark>](/function/shortcuts/base.md)<mark style="color:red;">`').start.total else (`</mark>[<mark style="color:blue;">`group_balance`</mark>](/function/functions/group-balance.md)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`counter`</mark>](/function/shortcuts/counter.md)<mark style="color:red;">`').start.total -`</mark>[<mark style="color:blue;">`group_balance`</mark>](/function/functions/group-balance.md)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`counter`</mark>](/function/shortcuts/counter.md)<mark style="color:red;">`').current.total)/(`</mark>[<mark style="color:blue;">`group_balance`</mark>](/function/functions/group-balance.md)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`base`</mark>](/function/shortcuts/base.md)<mark style="color:red;">`').current.total -`</mark>[<mark style="color:blue;">`group_balance`</mark>](/function/functions/group-balance.md)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`base`</mark>](/function/shortcuts/base.md)<mark style="color:red;">`').start.total)"`</mark>

```
ticker() if group_balance('counter').current.total == group_balance('counter').start.total else (group_balance('base').start.total-group_balance('base').current.total)/(group_balance('counter').current.total-group_balance('counter').start.total)
```

***

The orders will be placed at the price of the first market ask for sell orders and the first market bid for buy orders, adjusted by ±0.5%, respectively. Subsequent orders will be placed at increments of 0.5% of the price for each additional order.

<mark style="color:red;">`"execute_price": "(`</mark> [<mark style="color:blue;">`orderbook`</mark>](/function/functions/orderbook.md)<mark style="color:red;">`().bid[0].price if side==’`</mark>[<mark style="color:blue;">`buy`</mark>](/function/pre-defined-parameters/side.md)<mark style="color:red;">`’ else`</mark>  [<mark style="color:blue;">`orderbook`</mark>](/function/functions/orderbook.md)<mark style="color:red;">`().ask[0].price) * (1 + 0.005 *`</mark>[<mark style="color:blue;">`order_pos`</mark>](/function/pre-defined-parameters/order-pos.md)<mark style="color:red;">`)"`</mark>

```
(orderbook().bid[0].price if side==’buy’ else orderbook().ask[0].price) * (1 + 0.005 * order_pos)
```

***

Orders will be placed at the price level where the RSI is anticipated to reach 60 on 15-minute candlesticks.

<mark style="color:red;">`"execute_price": "`</mark>[<mark style="color:blue;">`rsi_to_price`</mark>](/function/technical-analysis/rsi-to-price.md)<mark style="color:red;">`(`</mark>[<mark style="color:blue;">`candles`</mark>](/function/functions/candles.md)<mark style="color:red;">`(’m15’), rsi_expected=60)"`</mark>

```
rsi_to_price(candles(’m15’), rsi_expected=60)
```

***

Place an order at the average closing price of the most recent 100 fifteen-minute candlesticks.

<mark style="color:red;">`"execute_price": "`</mark>[<mark style="color:blue;">`mean`</mark>](/function/functions/mean.md)<mark style="color:red;">`([candle.close for candle in`</mark> [<mark style="color:blue;">`candles`</mark>](/function/functions/candles.md)<mark style="color:red;">`('m15')])"`</mark>

```
mean([candle.close for candle in candles('m15')])
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.origami.tech/function/required-parameters/execute-price.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
