> 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

## 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.


---

# 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, and the optional `goal` query parameter:

```
GET https://nautilus-2.gitbook.io/seneca-docs/orders/orders.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
