# 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`](https://docs.origami.tech/function/pre-defined-parameters/side) or [`sell`](https://docs.origami.tech/function/pre-defined-parameters/side) 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`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) to facilitate the placement of multiple orders.
{% endhint %}

{% hint style="danger" %}
[<mark style="color:blue;">`execute_volume`</mark>](https://docs.origami.tech/function/required-parameters/execute-volume) 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>](https://docs.origami.tech/function/functions/ticker)<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>](https://docs.origami.tech/function/functions/orderbook)<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>](https://docs.origami.tech/function/functions/orderbook)<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>](https://docs.origami.tech/function/functions/orderbook)<mark style="color:red;">`('ETH-USDT','bybit').bid[0].price +`</mark> [<mark style="color:blue;">`orderbook`</mark>](https://docs.origami.tech/function/functions/orderbook)<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>](https://docs.origami.tech/function/functions/ticker)<mark style="color:red;">`() if`</mark> [<mark style="color:blue;">`group_balance`</mark>](https://docs.origami.tech/function/functions/group-balance)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`base`</mark>](https://docs.origami.tech/function/shortcuts/base)<mark style="color:red;">`').current.total ==`</mark> [<mark style="color:blue;">`group_balance`</mark>](https://docs.origami.tech/function/functions/group-balance)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`base`</mark>](https://docs.origami.tech/function/shortcuts/base)<mark style="color:red;">`').start.total else (`</mark>[<mark style="color:blue;">`group_balance`</mark>](https://docs.origami.tech/function/functions/group-balance)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`counter`</mark>](https://docs.origami.tech/function/shortcuts/counter)<mark style="color:red;">`').start.total -`</mark>[<mark style="color:blue;">`group_balance`</mark>](https://docs.origami.tech/function/functions/group-balance)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`counter`</mark>](https://docs.origami.tech/function/shortcuts/counter)<mark style="color:red;">`').current.total)/(`</mark>[<mark style="color:blue;">`group_balance`</mark>](https://docs.origami.tech/function/functions/group-balance)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`base`</mark>](https://docs.origami.tech/function/shortcuts/base)<mark style="color:red;">`').current.total -`</mark>[<mark style="color:blue;">`group_balance`</mark>](https://docs.origami.tech/function/functions/group-balance)<mark style="color:red;">`('`</mark>[<mark style="color:blue;">`base`</mark>](https://docs.origami.tech/function/shortcuts/base)<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>](https://docs.origami.tech/function/functions/orderbook)<mark style="color:red;">`().bid[0].price if side==’`</mark>[<mark style="color:blue;">`buy`</mark>](https://docs.origami.tech/function/pre-defined-parameters/side)<mark style="color:red;">`’ else`</mark>  [<mark style="color:blue;">`orderbook`</mark>](https://docs.origami.tech/function/functions/orderbook)<mark style="color:red;">`().ask[0].price) * (1 + 0.005 *`</mark>[<mark style="color:blue;">`order_pos`</mark>](https://docs.origami.tech/function/pre-defined-parameters/order-pos)<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>](https://docs.origami.tech/function/technical-analysis/rsi-to-price)<mark style="color:red;">`(`</mark>[<mark style="color:blue;">`candles`</mark>](https://docs.origami.tech/function/functions/candles)<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>](https://docs.origami.tech/function/functions/mean)<mark style="color:red;">`([candle.close for candle in`</mark> [<mark style="color:blue;">`candles`</mark>](https://docs.origami.tech/function/functions/candles)<mark style="color:red;">`('m15')])"`</mark>

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

</details>
