> This page is for TWS API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://interactivebrokers.com/docs/llms.txt.

# Adjustable Stops

You can attach one-time adjustments to stop, stop limit, trailing stop and trailing stop limit orders. When you attach an adjusted order, you set a trigger price that triggers a modification of the original (or parent) order, instead of triggering order transmission.

You can adjust any of the parent stop order types to any other stop order type; for example if you set up a Stop Limit, you can attach the one-time adjustment to change the order to a Trailing Stop, or if you start with a Stop order the adjustment can change it to a Trailing Stop Limit order.

## Adjusted to Stop

**TriggerPrice:** Price threshold for when the order type should just to the AdjustedOrderType value.

**AdjustedOrderType:** Resulting order type in the event an order passes the triggerPrice threshold.\
This can be "STP", "STP LMT", "TRAIL", "TRAILING LIMIT"

**AdjustedStopPrice:** The stop order's trigger price after being adjusted.

#### Python

```python
order = Order()
order.orderType = "TRAIL"
order.trailStopPrice = 100
order.auxPrice = 3

order.triggerPrice = triggerPrice
order.adjustedOrderType = "STP"
order.adjustedStopPrice = adjustStopPrice
```

#### Java

```java
Order order = new Order();
order.orderType("TRAIL");
order.trailStopPrice(100);
order.trailingPercent(2);

order.triggerPrice(triggerPrice);
order.adjustedOrderType(OrderType.STP);
order.adjustedStopPrice(adjustStopPrice);
```

#### C++

```cpp
Order order;
order.orderType = "TRAIL";
order.trailStopPrice = 100;
order.trailingPercent = 2;

order.triggerPrice = triggerPrice;
order.adjustedOrderType = "STP";
order.adjustedStopPrice = adjustStopPrice;
```

#### C\#

```csharp
Order order = new Order();
order.OrderType = "TRAIL";
order.TrailStopPrice = 100;
order.TrailingPercent = 2;

order.TriggerPrice = triggerPrice;
order.AdjustedOrderType = "STP";
order.AdjustedStopPrice = adjustStopPrice;
```

#### VB.NET

```vbnet
Dim order As Order = New Order
order.OrderType = "TRAIL"
order.TrailStopPrice = 100
order.TrailingPercent = 2

order.TriggerPrice = triggerPrice
order.AdjustedOrderType = "STP"
order.AdjustedStopPrice = adjustStopPrice
```

## Adjusted to Stop Limit

**TriggerPrice:** Price threshold for when the order type should just to the AdjustedOrderType value.

**AdjustedOrderType:** Resulting order type in the event an order passes the triggerPrice threshold.\
This can be "STP", "STP LMT", "TRAIL", "TRAILING LIMIT"

**AdjustedStopPrice:** The stop order's trigger price after being adjusted.

**AdjustedStopLimitPrice:** The stop order's limit price for execution after being adjusted.

#### Python

```python
order = Order()
order.orderType = "TRAIL"
order.trailStopPrice = 100
order.auxPrice = 3

order.triggerPrice = triggerPrice
order.adjustedOrderType = "STP LMT"
order.adjustedStopPrice = adjustStopPrice
order.adjustedStopLimitPrice = adjustedStopLimitPrice
```

#### Java

```java
Order order = new Order();
order.orderType("TRAIL");
order.trailStopPrice(100);
order.trailingPercent(2);

order.triggerPrice(triggerPrice);
order.adjustedOrderType("STP LMT");
order.adjustedStopPrice(adjustStopPrice);
order.adjustStopLimitPrice(adjustStopLimitPrice);
```

#### C++

```cpp
Order order;
order.orderType = "TRAIL";
order.trailStopPrice = 100;
order.trailingPercent = 2;

order.triggerPrice = triggerPrice;
order.adjustedOrderType = "STP LMT";
order.adjustedStopPrice = adjustStopPrice;
order.adjustedStopLimitPrice = adjustedStopLimitPrice;
```

#### C\#

```csharp
Order order = new Order();
order.OrderType = "TRAIL";
order.TrailStopPrice = 100;
order.TrailingPercent = 2;

order.TriggerPrice = triggerPrice;
order.AdjustedOrderType = "STP LMT";
order.AdjustedStopPrice = adjustStopPrice;
order.AdjustedStopLimitPrice = adjustedStopLimitPrice;
```

#### VB.NET

```vbnet
Dim order As Order = New Order
order.OrderType = "TRAIL"
order.TrailStopPrice = 100
order.TrailingPercent = 2

order.TriggerPrice = triggerPrice
order.AdjustedOrderType = "STP LMT"
order.AdjustedStopPrice = adjustStopPrice
order.AdjustedStopLimitPrice = adjustedStopLimitPrice
```

## Adjusted to Trail

**TriggerPrice:** Price threshold for when the order type should just to the AdjustedOrderType value.

**AdjustedOrderType:** Resulting order type in the event an order passes the triggerPrice threshold.\
This can be "STP", "STP LMT", "TRAIL", "TRAILING LIMIT".

**AdjustedStopPrice:** The trail order's trigger price after being adjusted.

**AdjustableTrailingUnit:** Dictate how trail should be adjusted.\
This can be "amt" or "%".

**AdjustedTrailingAmount:** The value to trail by. This will be a set amount or percentage based on the AdjustedTrailingUnit.

#### Python

```python
order = Order()
order.action = action
order.orderType = "STP"
order.auxPrice = stopPrice
order.totalQuantity = quantity

order.triggerPrice = triggerPrice
order.adjustedOrderType = "TRAIL"
order.adjustedStopPrice = adjustedStopPrice
order.adjustableTrailingUnit = trailUnit
order.adjustedTrailingAmount = adjustedTrailAmount
```

#### Java

```java
Order order = new Order();
order.action(action);
order.orderType("STP");
order.auxPrice(stopPrice);
order.totalQuantity(quantity);

order.triggerPrice(triggerPrice);
order.adjustedOrderType("TRAIL");
order.adjustedStopPrice(adjustStopPrice);
order.adjustableTrailingUnit(trailUnit);
order.adjustedTrailingAmount(adjustedTrailAmount);
```

#### C++

```cpp
Order order;
order.action = action;
order.orderType = "STP";
order.totalQuantity = quantity;
order.auxPrice = stopPrice;

order.triggerPrice = triggerPrice;
order.adjustedOrderType = "TRAIL";
order.adjustedStopPrice = adjustStopPrice;
order.adjustableTrailingUnit = trailUnit;
order.adjustedTrailingAmount = adjustedTrailAmount;
```

#### C\#

```csharp
Order order = new Order();
order.Action = action;
order.OrderType = "STP";
order.AuxPrice = stopPrice;
order.TotalQuantity = quantity;

order.TriggerPrice = triggerPrice;
order.AdjustedOrderType = "TRAIL";
order.AdjustedStopPrice = adjustedStopPrice;
order.AdjustableTrailingUnit = trailUnit;
order.AdjustedTrailingAmount = adjustedTrailAmount;
```

#### VB.NET

```vbnet
Dim order As Order = New Order
order.Action = action
order.OrderType = "STP"
order.AuxPrice = stopPrice
order.TotalQuantity = quantity

order.TriggerPrice = triggerPrice
order.AdjustedOrderType = "TRAIL"
order.AdjustedStopPrice = adjustedStopPrice
order.AdjustableTrailingUnit = trailUnit
order.AdjustedTrailingAmount = adjustedTrailAmount
```

## Adjusted to Trail Limit

**TriggerPrice:** Price threshold for when the order type should just to the AdjustedOrderType value.

**AdjustedOrderType:** Resulting order type in the event an order passes the triggerPrice threshold.\
This can be "STP", "STP LMT", "TRAIL", "TRAILING LIMIT".

**AdjustedStopPrice:** The trail order's trigger price after being adjusted.

**AdjustedStopLimitPrice:** The trailing order's limit price for execution after being adjusted.

**AdjustableTrailingUnit:** Dictate how trail should be adjusted.\
This can be "amt" or "%".

**AdjustedTrailingAmount:** The value to trail by. This will be a set amount or percentage based on the AdjustedTrailingUnit.

#### Python

```python
order = Order()
order.action = action
order.orderType = "STP"
order.auxPrice = stopPrice
order.totalQuantity = quantity

order.triggerPrice = triggerPrice
order.adjustedOrderType = "TRAIL LIMIT"
order.adjustedStopPrice = adjustedStopPrice
order.adjustedStopLimitPrice = adjustedStopLimitPrice
order.adjustableTrailingUnit = trailUnit
order.adjustedTrailingAmount = adjustedTrailAmount
```

#### Java

```java
Order order = new Order();
order.action(action);
order.orderType("STP");
order.auxPrice(stopPrice);
order.totalQuantity(quantity);

order.triggerPrice(triggerPrice);
order.adjustedOrderType("TRAIL LIMIT");
order.adjustedStopPrice(adjustStopPrice);
order.adjustStopLimitPrice(adjustStopLimitPrice);
order.adjustableTrailingUnit(trailUnit);
order.adjustedTrailingAmount(adjustedTrailAmount);
```

#### C++

```cpp
Order order;
order.action = action;
order.orderType = "STP";
order.totalQuantity = quantity;
order.auxPrice = stopPrice;

order.triggerPrice = triggerPrice;
order.adjustedOrderType = "TRAIL LIMIT";
order.adjustedStopPrice = adjustStopPrice;
order.adjustedStopLimitPrice = adjustedStopLimitPrice;
order.adjustableTrailingUnit = trailUnit;
order.adjustedTrailingAmount = adjustedTrailAmount;
```

#### C\#

```csharp
Order order = new Order();
order.Action = action;
order.OrderType = "STP";
order.AuxPrice = stopPrice;
order.TotalQuantity = quantity;

order.TriggerPrice = triggerPrice;
order.AdjustedOrderType = "TRAIL LIMIT";
order.AdjustedStopPrice = adjustedStopPrice;
order.AdjustedStopLimitPrice = adjustedStopLimitPrice;
order.AdjustableTrailingUnit = trailUnit;
order.AdjustedTrailingAmount = adjustedTrailAmount;
```

#### VB.NET

```vbnet
Dim order As Order = New Order
order.Action = action
order.OrderType = "STP"
order.AuxPrice = stopPrice
order.TotalQuantity = quantity

order.TriggerPrice = triggerPrice
order.AdjustedOrderType = "TRAIL LIMIT"
order.AdjustedStopPrice = adjustedStopPrice
order.AdjustedStopLimitPrice = adjustedStopLimitPrice
order.AdjustableTrailingUnit = trailUnit
order.AdjustedTrailingAmount = adjustedTrailAmount
```