# `Bourse.Order.Builder`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/order/builder.ex#L1)

Fluent builder for unified order creation.

Accumulates order options and submits through `Bourse.create_order/6`.

# `t`

```elixir
@type t() :: %Bourse.Order.Builder{
  amount: number(),
  params: keyword(),
  side: String.t(),
  symbol: String.t(),
  type: String.t()
}
```

# `limit`

```elixir
@spec limit(t(), number()) :: t()
```

Turns the order into a limit order with `price`.

# `new`

```elixir
@spec new(String.t(), String.t(), number()) :: t()
```

Starts a market order builder for `symbol`, `side`, and `amount`.

# `stop_loss`

```elixir
@spec stop_loss(t(), number()) :: t()
```

Adds a stop-loss price.

# `submit`

```elixir
@spec submit(t(), Bourse.Exchange.t(), Bourse.Credentials.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), [Bourse.Order.Sanity.reason()]} | {:error, term()}
```

Submits the order through `Bourse.create_order/6` using `credentials`.

# `take_profit`

```elixir
@spec take_profit(t(), number()) :: t()
```

Adds a take-profit price.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
