> 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://ibkrcampus.com/docs/llms.txt.

# Order Status

## Introduction

`EWrapper.orderStatus` gives the up-to-date information of an order every time it changes. Often there are duplicate `orderStatus` messages.

---

## Order Status

`EWrapper.orderStatus(orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld, mktCapPrice)`

**`orderId`** `int`

The order's client id.

---

**`status`** `string`

The current status of the order.

---

**`filled`** `decimal`

Number of filled positions.

---

**`remaining`** `decimal`

The remnant positions.

---

**`avgFillPrice`** `double`

Average filling price.

---

**`permId`** `int`

The order's permId used by the TWS to identify orders.

---

**`parentId`** `int`

Parent's id. Used for bracket and auto trailing stop orders.

---

**`lastFillPrice`** `double`

Price at which the last positions were filled.

---

**`clientId`** `int`

API client which submitted the order.

---

**`whyHeld`** `string`

This field is used to identify an order held when TWS is trying to locate shares for a short sell. The value used to indicate this is 'locate'.

---

**`mktCapPrice`** `double`

If an order has been capped, this indicates the current capped price.

---

\


#### Python

```python
def orderStatus(self, orderId: OrderId, status: str, filled: Decimal, remaining: Decimal, avgFillPrice: float, permId: int, parentId: int, lastFillPrice: float, clientId: int, whyHeld: str, mktCapPrice: float):
	super().orderStatus(orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld, mktCapPrice)
```

#### Java

```java
@Override
public void orderStatus(int orderId, String status, Decimal filled, Decimal remaining, double avgFillPrice, int permId, int parentId, double lastFillPrice, int clientId, String whyHeld, double mktCapPrice) {
	System.out.println(EWrapperMsgGenerator.orderStatus( orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld, mktCapPrice));
}
```

#### C++

```cpp
void TestCppClient::orderStatus(OrderId orderId, const std::string& status, Decimal filled, Decimal remaining, double avgFillPrice, int permId, int parentId, double lastFillPrice, int clientId, const std::string& whyHeld, double mktCapPrice){
    printf(orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld, mktCapPrice);
}
```

#### C\#

```csharp
public virtual void orderStatus(int orderId, string status, decimal filled, decimal remaining, double avgFillPrice, int permId, int parentId, double lastFillPrice, int clientId, string whyHeld, double mktCapPrice)
{
	Console.WriteLine("OrderStatus. Id: " + orderId + ", Status: " + status + ", Filled: " + Util.DecimalMaxString(filled) + ", Remaining: " + Util.DecimalMaxString(remaining)
		+ ", AvgFillPrice: " + Util.DoubleMaxString(avgFillPrice));
}
```

#### VB.NET

```vbnet
Public Sub orderStatus(orderId As Integer, status As String, filled As Decimal, remaining As Decimal, avgFillPrice As Double, permId As Integer, parentId As Integer, lastFillPrice As Double, clientId As Integer, whyHeld As String, mktCapPrice As Double) Implements IBApi.EWrapper.orderStatus
	Console.WriteLine(orderId , status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld, mktCapPrice)
End Sub
```

---

## Understanding Order Status Message

| Status        | Description                                                                                                                                                                                                                                                                                                |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Inactive      | Indicates that you are in the process of creating an order and you have not yet activated or transmitted it.                                                                                                                                                                                               |
| PendingSubmit | Indicates that you have transmitted your order, but have not yet received confirmation that it has been accepted by the order destination.                                                                                                                                                                 |
| PreSubmitted  | Indicates that an order has been accepted by the system (simulated orders) or an exchange (native orders) and that this order has yet to be elected.                                                                                                                                                       |
| Submitted     | Indicates that your order has been accepted and is working at the destination.                                                                                                                                                                                                                             |
| Filled        | Order has been completely filled.                                                                                                                                                                                                                                                                          |
| PendingCancel | Indicates that you have sent a request to cancel the order but have not yet received cancel confirmation from the order destination. At this point, your order is not confirmed canceled. You may still receive an execution while your cancellation request is pending.                                   |
| PreCancelled  | Indicates that a cancellation request has been accepted by the system but that currently the request is not being recognized, due to system, exchange or other issues. At this point, your order is not confirmed canceled. You may still receive an execution while your cancellation request is pending. |
| Cancelled     | Indicates that the balance of your order has been confirmed canceled by the system. This could occur unexpectedly when the destination has rejected your order.                                                                                                                                            |
| WarnState     | Order has a specific warning message such as for basket orders.                                                                                                                                                                                                                                            |