> For the complete documentation index, see [llms.txt](https://nautilus-2.gitbook.io/seneca-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nautilus-2.gitbook.io/seneca-docs/orders/orders.md).

# Orders

Learn how to turn a signal into an order

## Understanding Signal Bars

Bars begin at `prediction_datetime` and the signal information associated with that bar applies to the order for the live/incomplete bar `prediction_datetime + 1`.  The signal information associated with the `prediction_datetime` bar applies to the end of the bar i.e. the bar beginning `prediction_datetime + 1`&#x20;

**Example workflow:**

1. Server time is `11:05`, which means we are trading the `11:00` incomplete bar
2. The latest signal from the `/signals` endpoint will have `prediction_datetime = 10:00`, which represents the lastest complete bar
3. The signal details in the latest signal (`prediction_datetime = 10:00)` apply to the end of that bar, so the bar beginning `prediction_datetime = 11:00`
4. Therefore the current order data at `11:05` will come from the signal record where `prediction_datetime = 10:00`

## Constructing an Order

Order size should be constructed as the delta between exchange-realized position and the following fields returned by signals endpoint:&#x20;

* `direction`
* `position_trade_blocks`
* `action`&#x20;

**Adding to position:**

1. Exchange position is long 12 trade blocks
2. Latest signal is `"position_trade_blocks": 13, "position": "long", "action": "add"` &#x20;
3. Go long (13 - 12 ) = **1 trade block**

**Flipping position:**

1. Exchange position is long 12 trade blocks
2. Latest signal is `"position_trade_blocks": 4, "position": "short", "action": "flip"`
3. Go short (12 + 4) = **16 trade blocks**

## Recording Orders

We ask that you POST back your exchange order so that we have an audit trail for your trades:

{% code title="Successful order execution" %}

```json
curl -X POST "https://api.nautilus.finance/api/v1/exchange-submissions" \
  -H "X-API-Key: <your_api_key>" \
  -d '{
    "exchange": "binance",
    "payload": {
      "order_id": "12345",
      "symbol": "BTCUSDT",
      "side": "buy",
      "quantity": 0.01,
      "price": 67000.00,  # fill price
      "timestamp": "2025-12-15T10:30:00Z"  # UTC
    },
    "success": true  # whether the trade was successful
  }'
```

{% endcode %}

Please update fill information like `price` and `success` .

## Stop Loss/Take Profit

We recommend setting stop loss of -10%  and take profit of 10% on your orders, scaled by leverage level.
