# TradeCreate

A Trade represents an entire order made by a client. Trades can hold one or many executions representing partial fills that aggregate into a whole order.

## Example Usage

```typescript
import {
  RouteType,
  TradeCreate,
  TradeCreateAssetType,
  TradeCreateBrokerCapacity,
  TradeCreateIdentifierType,
  TradeCreateSide,
} from "@apexfintechsolutions/ascend-sdk/models/components";

let value: TradeCreate = {
  accountId: "02HASWB2DTMRT3DAM45P56J2T2",
  assetType: TradeCreateAssetType.Equity,
  brokerCapacity: TradeCreateBrokerCapacity.Agency,
  clientOrderId: "00be5285-0623-4560-8c58-f05af2c56ba0",
  executions: [
    {
      executionTime: new Date("2024-07-17T12:00:00Z"),
      externalId: "0H06HAP3A3Y",
      price: {},
      quantity: {},
    },
  ],
  identifier: "AAPL",
  identifierType: TradeCreateIdentifierType.Symbol,
  routeType: RouteType.Mngd,
  side: TradeCreateSide.Buy,
  sourceApplication: "Trading-App",
};
```

## Fields

| Field                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Required                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `accountId`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | A globally unique identifier referencing a single account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | 02HASWB2DTMRT3DAM45P56J2T2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `additionalInstructions`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Free form instructions that can be used to provide additional instructions (that are not captured by existing special instructions) and will be put on the trade confirm.                                                                                                                                                                                                                                                                                                                                                                                                                                          | ACATS instruction                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `alternateOrderId`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Fractional support for market-makers' internal order ids.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | 00ce5285-0624-4260-8c58-g05af2c56ba5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `assetType`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | [components.TradeCreateAssetType](../../models/components/tradecreateassettype.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Type of the asset being traded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | EQUITY                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `brokerCapacity`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | [components.TradeCreateBrokerCapacity](../../models/components/tradecreatebrokercapacity.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Broker capacity for the trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | AGENCY                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `clientOrderId`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | The unique identifier that is associated with an order. Must be unique by date per trade per client.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | 00be5285-0623-4560-8c58-f05af2c56ba0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `executingBroker`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Executing broker of the trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | NITE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `executions`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | [components.ExecutionCreate](../../models/components/executioncreate.md)[]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | The executions (sometimes referred to as partial-fills) that comprise the trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `fees`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [components.BookingFeeCreate](../../models/components/bookingfeecreate.md)[]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Any client calculated fees associated with the trade. Only allowed if trade.open = false. Regulatory fees will be calculated automatically if they are not explicitly overwritten or suppressed.                                                                                                                                                                                                                                                                                                                                                                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `identifier`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Identifier (of the type specified in `identifier_type`). Responses will supply the originally requested identifier.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | AAPL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `identifierType`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | [components.TradeCreateIdentifierType](../../models/components/tradecreateidentifiertype.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Identifier type for the asset being traded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | SYMBOL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `issuingRegionCode`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Unicode CLDR region code. Issuing Region Code is required for some `identifier_type`s, especially CUSIP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | US                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `localMarketTradeDate`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [components.DateCreate](../../models/components/datecreate.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:<br/><br/> * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date<br/><br/> Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`. |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `lotMatchingInstructions`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | [components.LotCreate](../../models/components/lotcreate.md)[]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | One or many lot matching instructions for the trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `micCode`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Market Identifier Code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | XNAS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `open`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | *boolean*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | State of this trade's completeness in filling. True: trade is not done filling and can append more executions onto the trade False: trade is done filling and cannot append more executions onto the trade By default, trades are closed when they are created. An open trade can later be closed by calling the CompleteTrade endpoint. Additional executions can be appended to an open trade by calling the CreateExecution endpoint. Trades that are left open will be automatically closed nightly before Ledger's EOD.                                                                                       | false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `orderId`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Street-level order id, unique by day per broker.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | 00be6285-0623-4260-8c58-g05af2c56ba2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `routeType`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | [components.RouteType](../../models/components/routetype.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Route type for the trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | MNGD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `settlementDate`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | [components.DateCreate](../../models/components/datecreate.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:<br/><br/> * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date<br/><br/> Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`. |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `side`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [components.TradeCreateSide](../../models/components/tradecreateside.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Denotes if the trade is a SELL or a BUY.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | BUY                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `sideModifier`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | [components.TradeCreateSideModifier](../../models/components/tradecreatesidemodifier.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Side modifier for the trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | OPEN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `sourceApplication`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | *string*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | :heavy_check_mark:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | The source of the submission.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Trading-App                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `specialInstructions`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | [components.SpecialInstructions](../../models/components/specialinstructions.md)[]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | An enumerated list of values used to indicate certain attributes about a trade (E.g. DISCRETION_EXERCISED, BROKER_LIQUIDATION) and/or trigger downstream processing rules (e.g. SUPPRESS_TRACE_REPORTING)                                                                                                                                                                                                                                                                                                                                                                                                          | [<br/>"SUPPRESS_SEC_FEE",<br/>"WITH_DIVIDEND"<br/>]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `venue`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | [components.Venue](../../models/components/venue.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Exchange venue                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | NASDAQ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `whenIssued`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | [components.WhenIssued](../../models/components/whenissued.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Denotes that this trade was either when_issued or when_distributed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | WHEN_ISSUED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |