> For the complete documentation index, see [llms.txt](https://docs.architect.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.architect.co/algos-book/spreader/spread-level-configuration.md).

# Spread Level Configuration

| Parameter                                   | Description                                                                                                                                                                               |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dir *(OrderDir)*                            | Designate your order as buy or sell with the binary enums `OrderDir.BUY` or `OrderDir.SELL`                                                                                               |
| quantity *(decimal)*                        | The quantity to execute. The algorithm terminates when each leg `i` is filled to the nearest lot less than or equal to `quantity * quantity_ratio[i]`                                     |
| limit\_price *(decimal)*                    | The most aggressive price the spread will take or quote at defined as a spread price.                                                                                                     |
| leg1 *(LegParams)*                          | See [Leg Configuration](/algos-book/spreader/leg-configuration.md)                                                                                                                        |
| leg2 *(LegParams)*                          | See [Leg Configuration](/algos-book/spreader/leg-configuration.md)                                                                                                                        |
| taking\_parameters *(TakingParameters)*     | See [TakingParameters](#takingparameters)                                                                                                                                                 |
| missed\_hedge\_policy *(MissedTakePolicy)*  | Specify how you want to deal with missed hedges or takes on one leg. Either **MissedTakePolicy.Halt** to pause the autospreader, or **MissedTakePolicy.Continue** to  ignore and continue |
| missed\_hedge\_wait\_time *(HumanDuration)* | Specify a certain amount of time an unfilled hedge waits before your configured **MissedTakePolicy** triggers                                                                             |

### TakingParameters

| Parameter                                      | Description                                                                                                                                                                                                                                           |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| min\_quantity\_threshold *(decimal, optional)* | Minimum quantity needed on the spread quantity for the spread before firing. However, if the remaining spread quantity is below this threshold, the `min_quantity_threshold` will be ignored so that the spread can submit the remainder of its order |
| max\_fire\_quantity *(decimal, optional)*      | Maximum fire/take quantity at once                                                                                                                                                                                                                    |
| take\_lockout *(HumanDuration)*                | Specify a certain amount of time before another spread-taking order can fire again                                                                                                                                                                    |

{% tabs %}
{% tab title="Python" %}

```python
from architect_py import (
    SpreaderParams,
    LegParams,
    QuotingParameters,
    TakingParameters,
    MissedTakePolicy,
    OrderDir,
    HumanDuration,
)
 
symbol1 = 'NQ 20251219 CME Future' 
symbol2 = 'MNQ 20251219 CME Future'
tp1 = f"{symbol1}/USD"
tp2 = f"{symbol2}/USD"
account = "PAPER:example@email.com"
venue = "CME"
params = SpreaderParams.new(
    dir=OrderDir.BUY,
    quantity=100,
    limit_price=10,
    leg1=LegParams.new(
        symbol=tp1,
        marketdata_venue=venue,
        execution_venue=venue,
        quantity_ratio=1,
        price_multiplier=1,
        price_offset=0,
        chase_ticks=0,
        quoting_parameters=QuotingParameters.new(max_quote_quantity=2),
    ),
    leg2=LegParams.new(
        symbol=tp2,
        marketdata_venue=venue,
        execution_venue=venue,
        quantity_ratio=-10,
        price_multiplier=-1,
        price_offset=0,
        chase_ticks=0,
        quoting_parameters=QuotingParameters.new(max_quote_quantity=20),
    ),
    taking_parameters=TakingParameters.new(
        min_quantity_threshold=None,
        max_fire_quantity=None,
        take_lockout=None,
    ),
    missed_hedge_policy=MissedTakePolicy.Halt,
    missed_hedge_wait_time=HumanDuration('30s'),
)

order = await client.place_algo_order(params=params, account=account)
```

{% endtab %}
{% endtabs %}


---

# 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://docs.architect.co/algos-book/spreader/spread-level-configuration.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.
