Trade
The Trade Entity stores all the information about a bargain that is recorded in MarketGrid. It consists of a reference to both the buy and the sell Orders that produced the Trade as well as details about the Trade itself, such as price and quantity.
- Section: Trading
Metadata
- Base Table Class: Entity
- Default Size: 1000
Fields
| Name | Type | Size (bytes) | Description |
|---|---|---|---|
| Id | Integer (signed) | 8 | The unique identifier of this Trade. |
| Status | Set of Status | 4 | |
| Reference | String | 20 | The published identifier for this Trade. It is a string of characters that uniquely identifies every Trade in the system. |
| Order | Foreign key to Order | 8 | An Order is the fundamental record of trading activity in the system. |
| User | Foreign key to User | 8 | |
| Firm | Foreign key to Firm | 8 | |
| Account | Foreign key to Account | 8 | |
| Holding | Foreign key to Holding | 8 | |
| Cash | Foreign key to Holding | 8 | |
| TradeStatus | Set of TradeStatus | 1 | |
| TradeType | One of TradeType | 1 | |
| ExchangeRate | Integer (signed) | 8 | |
| FeeExchangeRate | Integer (signed) | 8 | |
| PriceDecimals | Integer (unsigned) | 1 | The number of decimal places that should be used when interpreting prices for this Trade. Prices within MarketGrid are stored and communicated as integers with fixed numbers of decimals. This field specifies how many digits are to the right of the decimal point. For example, a price of 10350 with PriceDecimals set to 2 means 103.50. |
| QuantityDecimals | Integer (unsigned) | 1 | The number of decimal places that should be used when interpreting quantities for this Trade. Quantities within MarketGrid are stored and communicated as integers with fixed numbers of decimals. This field specifies how many digits are to the right of the decimal point. For example, a quantity of 12345 with QuantityDecimals set to 3 means 12.345. |
| ValueDecimals | Integer (unsigned) | 1 | The number of decimal places that should be used when interpreting the value of this Trade. Values within MarketGrid are stored and communicated as integers with fixed numbers of decimals. This field specifies how many digits are to the right of the decimal point. For example, a value of 1150000 with ValueDecimals of 2 means 11,500.00. |
| SettlementValueDecimals | Integer (unsigned) | 1 | The number of decimal places that should be used when interpreting the value of this Trade. Values within MarketGrid are stored and communicated as integers with fixed numbers of decimals. This field specifies how many digits are to the right of the decimal point. For example, a value of 1150000 with SettlementValueDecimals of 2 means 11,500.00. |
| FeeCurrencyDecimals | Integer (unsigned) | 1 | The number of decimal places that should be used when interpreting the value of this Trade. Values within MarketGrid are stored and communicated as integers with fixed numbers of decimals. This field specifies how many digits are to the right of the decimal point. For example, a value of 1150000 with FeeCurrencyDecimals of 2 means 11,500.00. |
| Price | Integer (signed) | 8 | The current Price for this Trade instance. |
| Quantity | Integer (signed) | 8 | The quantity of securities transferred as a result of this trade. |
| Value | Integer (signed) | 8 | The value of this Trade in the currency in which it will settle. |
| SettlementValue | Integer (signed) | 8 | |
| LimitValue | Integer (signed) | 8 | |
| Fee | Integer (signed) | 8 | |
| ExternalCosts | Integer (signed) | 8 | |
| SettledValue | Integer (signed) | 8 | |
| SettledQuantity | Integer (signed) | 8 | |
| SettledFee | Integer (signed) | 8 | |
| SettledExternalCosts | Integer (signed) | 8 | |
| CancelledValue | Integer (signed) | 8 | |
| CancelledQuantity | Integer (signed) | 8 | |
| CancelledFee | Integer (signed) | 8 | |
| CancelledExternalCosts | Integer (signed) | 8 | |
| Aggressor | One of Aggressor | 1 | A measure of the aggressor in the last traded price. The value may be -1, 0 or 1 depending on whether the aggressor was the buyer or the seller for the trade. |
| Swing | Integer (signed) | 8 | The direction of the last change in traded price. |
| MetaData | String | 20 | |
| SettlementStatus | Set of SettlementStatus | 1 | |
| HoldingQuantity | Integer (signed) | 8 | The value of this Trade in terms of the Holding to which it is related. |
| Increment | Integer (signed) | 8 | The change in price resulting from the last trade. |
| InstrumentMarket | Foreign key to InstrumentMarket | 8 | InstrumentMarket is the entity that represents an Instrument_ in a specific Market_. It is the entity for which all trading activity is undertaken and at which level all the market data is collected for distribution. |
| Tag | String | 50 | For tagged Instruments, this is the identifier of the individual holding. |
| SettlementClass | Foreign key to SettlementClass | 8 | |
| ProjectId | String | 50 | The identifier of the specific project at the external register associated with this Trade record. |
| Vintage | Integer (unsigned) | 4 | A year in YYYY format. |
| Side | One of OrderSide | 1 | Whether this is a Buy (0) or a Sell (1). |
| CounterPartyOrder | Foreign key to Order | 8 | An Order is the fundamental record of trading activity in the system. |
| CounterPartyAccount | Foreign key to Account | 8 | This can't be derived from the CP Order for child trades allocated in a CCMX Auction so we need to store it with the Trade record. |
| ClOrdID | String | 60 | In the FIX protocol the ClOrdID field is the user supplied identifier for an inbound Order that the user will provide to identify the Order when acting on the Order. When referring to an exising Order the user will use the OrigClOrdID field to identify the ClOrdID of the Order in question. |
| Currency | Foreign key to Instrument | 8 | An Instrument is the entity that represents something to be traded in MarketGrid. In order for an Instrument to trade it must be listed on a Market_ to produce an InstrumentMarket_. Each Instrument may be traded simultaneously on one or more Markets, each such instance being an InstrumentMarket_. |
| OrderMatched | Integer (signed) | 8 | |
| OrderBalance | Integer (signed) | 8 | |
| FeeReturned | Integer (signed) | 8 | |
| AuctionRecord | Integer (unsigned) | 4 | Record number for proposed trades for tender offers. |
| SettlementSort | Integer (unsigned) | 4 | For trades on CCMX Auctions, this is the order in which the trade records should be processed for settlement. |
| NetProceedsPaidToIssuer | Integer (signed) | 8 | For Trades on CCMX Auctions, this is the portion of the settlement value for the trade paid to the Issuer rather than the seller. |
| PreliminaryExternalTaxCosts | Integer (signed) | 8 | |
| PreliminaryExternalExerciseCosts | Integer (signed) | 8 | |
| PreliminaryExternalTaxCostsUsed | Integer (signed) | 8 | |
| PreliminaryExternalExerciseCostsUsed | Integer (signed) | 8 | |
| AuctionAccount | Foreign key to AuctionAccount | 8 | |
| UpdateNumber | Integer (unsigned) | 8 | A number that records every change that happens to a record. It is primarily used to avoid write after read problems when an intermediate write has changed the originally read record. |
| OwnerUser | Foreign key to User | 8 | The Id of the User that owns this Trade. |
| OwnerGroup | Foreign key to Group | 8 | The Id of the Group that owns this Trade. |
| OwnerFirm | Foreign key to Firm | 8 | The Id of the Firm that owns this Trade. |
| CreateUser | Foreign key to User | 8 | The Id of the User that created this Trade. |
| CreateTimestamp | Integer (unsigned) | 8 | The time at which this Trade was created. |
| UpdateUser | Foreign key to User | 8 | The Id of the User that last updated this Trade. |
| UpdateTimestamp | Integer (unsigned) | 8 | The time at which this Trade was last updated. |
Foreign Keys
The following diagram shows the tables that have a foreign key link to the Trade table. All Table nodes can be clicked to take you to that table's definition page.
graph LR; OptionExercise-->|Trade|Trade click OptionExercise "/marketgrid/developer/model/tables/OptionExercise" SecuritySold-->|Trade|Trade click SecuritySold "/marketgrid/developer/model/tables/SecuritySold" HoldingTransaction-->|Trade|Trade click HoldingTransaction "/marketgrid/developer/model/tables/HoldingTransaction" TradePreliminarySettlementData-->|Trade|Trade click TradePreliminarySettlementData "/marketgrid/developer/model/tables/TradePreliminarySettlementData" Trade_children-->|Parent|Trade click Trade_children "/marketgrid/developer/model/tables/Trade_children" TradeFee-->|Trade|Trade click TradeFee "/marketgrid/developer/model/tables/TradeFee"