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.

Metadata

  • Base Table Class: Entity
  • Default Size: 1000

Fields

NameTypeSize (bytes)Description
IdInteger (signed)8The unique identifier of this Trade.
StatusSet of Status4
ReferenceString20The published identifier for this Trade. It is a string of characters that uniquely identifies every Trade in the system.
OrderForeign key to Order8An Order is the fundamental record of trading activity in the system.
UserForeign key to User8
FirmForeign key to Firm8
AccountForeign key to Account8
HoldingForeign key to Holding8
CashForeign key to Holding8
TradeStatusSet of TradeStatus1
TradeTypeOne of TradeType1
ExchangeRateInteger (signed)8
FeeExchangeRateInteger (signed)8
PriceDecimalsInteger (unsigned)1The 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.
QuantityDecimalsInteger (unsigned)1The 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.
ValueDecimalsInteger (unsigned)1The 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.
SettlementValueDecimalsInteger (unsigned)1The 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.
FeeCurrencyDecimalsInteger (unsigned)1The 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.
PriceInteger (signed)8The current Price for this Trade instance.
QuantityInteger (signed)8The quantity of securities transferred as a result of this trade.
ValueInteger (signed)8The value of this Trade in the currency in which it will settle.
SettlementValueInteger (signed)8
LimitValueInteger (signed)8
FeeInteger (signed)8
ExternalCostsInteger (signed)8
SettledValueInteger (signed)8
SettledQuantityInteger (signed)8
SettledFeeInteger (signed)8
SettledExternalCostsInteger (signed)8
CancelledValueInteger (signed)8
CancelledQuantityInteger (signed)8
CancelledFeeInteger (signed)8
CancelledExternalCostsInteger (signed)8
AggressorOne of Aggressor1A 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.
SwingInteger (signed)8The direction of the last change in traded price.
MetaDataString20
SettlementStatusSet of SettlementStatus1
HoldingQuantityInteger (signed)8The value of this Trade in terms of the Holding to which it is related.
IncrementInteger (signed)8The change in price resulting from the last trade.
InstrumentMarketForeign key to InstrumentMarket8InstrumentMarket 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.
TagString50For tagged Instruments, this is the identifier of the individual holding.
SettlementClassForeign key to SettlementClass8
ProjectIdString50The identifier of the specific project at the external register associated with this Trade record.
VintageInteger (unsigned)4A year in YYYY format.
SideOne of OrderSide1Whether this is a Buy (0) or a Sell (1).
CounterPartyOrderForeign key to Order8An Order is the fundamental record of trading activity in the system.
CounterPartyAccountForeign key to Account8This 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.
ClOrdIDString60In 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.
CurrencyForeign key to Instrument8An 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_.
OrderMatchedInteger (signed)8
OrderBalanceInteger (signed)8
FeeReturnedInteger (signed)8
AuctionRecordInteger (unsigned)4Record number for proposed trades for tender offers.
SettlementSortInteger (unsigned)4For trades on CCMX Auctions, this is the order in which the trade records should be processed for settlement.
NetProceedsPaidToIssuerInteger (signed)8For Trades on CCMX Auctions, this is the portion of the settlement value for the trade paid to the Issuer rather than the seller.
PreliminaryExternalTaxCostsInteger (signed)8
PreliminaryExternalExerciseCostsInteger (signed)8
PreliminaryExternalTaxCostsUsedInteger (signed)8
PreliminaryExternalExerciseCostsUsedInteger (signed)8
AuctionAccountForeign key to AuctionAccount8
UpdateNumberInteger (unsigned)8A 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.
OwnerUserForeign key to User8The Id of the User that owns this Trade.
OwnerGroupForeign key to Group8The Id of the Group that owns this Trade.
OwnerFirmForeign key to Firm8The Id of the Firm that owns this Trade.
CreateUserForeign key to User8The Id of the User that created this Trade.
CreateTimestampInteger (unsigned)8The time at which this Trade was created.
UpdateUserForeign key to User8The Id of the User that last updated this Trade.
UpdateTimestampInteger (unsigned)8The 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"