Holding_change
A Holding describes the position held by an Account_ for a given Instrument_. Such a position is a combination of the balance at the start of the day and the aggregate actual buys and sells completed since the opening balance.
In addition, the balances of planned transactions (effectively the unmatched Order_ records) are also recorded here for the purposes of monitoring and risk management.
This is an entity to record changes in the Holding structure. It holds records that are already prepared for sending out via the market data streams (for example resolving internal shared memory indexes into external foreign key Ids)
- Section: Change Tables
Metadata
- Base Table Class: Change
- Default Size: Order + Trade = 2000
Fields
| Name | Type | Size (bytes) | Description |
|---|---|---|---|
| Id | Integer (signed) | 8 | The unique identifier of this Holding. |
| Status | Set of Status | 4 | |
| Timestamp | Integer (unsigned) | 8 | The time at which this change record was generated. This is not the same as the business-level timestamp of this Holding_change. |
| ExternalAccount | Foreign key to ExternalAccount | 8 | |
| Firm | Foreign key to Firm | 8 | |
| Account | Foreign key to Account | 8 | |
| AccountName | String | 254 | |
| Instrument | Foreign key to Instrument | 8 | |
| Tag | String | 50 | For tagged Instruments, this is the identifier of the individual holding. |
| ExternalId | String | 30 | A place for writing the identifier of this Holding_change at the external venue where it is managed. |
| ExternalTransactionId | String | 20 | A place for writing the identifier of the external transaction that is connected with this Holding_change record at the external venue to which it is related. |
| QuantityDecimals | Integer (unsigned) | 1 | The number of decimal places that should be used when interpreting quantities for this Holding_change. 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. |
| OpenBalance | Integer (signed) | 8 | The balance of the Instrument to which this Holding relates, in this Account at the time of starting the Trading Engine. Copied from Balance & only updated during a cycle. |
| PlannedBuy | Integer (signed) | 8 | The sum of the buy Orders currently placed but unmatched in the system for this Account / Instrument. |
| PlannedSell | Integer (signed) | 8 | The sum of the buy Orders currently placed but unmatched in the system for this Account / Instrument. |
| OptimisedReservedCashRequired | Integer (signed) | 8 | For a single-price Auction, this is the PlannedSell that has been optimised. |
| OptimisedReservedCash | Integer (signed) | 8 | Reserved cash required less unfunded bids. |
| AuctionResiduals | Integer (signed) | 8 | Total of MaxResidual for all auctions that the account is active on. Only used for leaf accounts. |
| ActualBuy | Integer (signed) | 8 | The sum of the matched buy Orders currently placed in the system for this Account |
| ActualSell | Integer (signed) | 8 | The sum of the matched sell Orders currently placed in the system for this Account |
| UnsettledBuy | Integer (signed) | 8 | For externally settled trades, buys/sells move from planned to unsettled and must be moved to actual via a HoldingTransaction. |
| UnsettledSell | Integer (signed) | 8 | For externally settled trades, buys/sells move from planned to unsettled and must be moved to actual via a HoldingTransaction. |
| PendingBuyTradeCosts | Integer (signed) | 8 | |
| PendingSellTradeCosts | Integer (signed) | 8 | |
| UnsettledBuyTradeCosts | Integer (signed) | 8 | |
| UnsettledSellTradeCosts | Integer (signed) | 8 | |
| ActualBuyTradeCosts | Integer (signed) | 8 | |
| ActualSellTradeCosts | Integer (signed) | 8 | |
| PendingDeposit | Integer (signed) | 8 | |
| PendingWithdrawal | Integer (signed) | 8 | |
| ApprovedDeposit | Integer (signed) | 8 | |
| ApprovedWithdrawal | Integer (signed) | 8 | |
| PendingReturn | Integer (signed) | 8 | |
| AvailableBalance | Integer (signed) | 8 | The total quantity of this Instrument available to sell for this Account. In the simplest terms, it is the difference between the sum of OpeningBalance and ActualBuy less the ActualSell if short selling checking is enabled for the Instrument or Firm to which the Account belongs. AvailableBalance will not be allowed to go below zero if short selling is not allowed. Its value depends on CanResellToday. - If CanResellToday is set (value 1), then: AvailableBalance = OpenBalance + ActualBuy - (ActualSell + PlannedSell) - If CanResellToday is not set (value 0), then: AvailableBalance = OpenBalance - (ActualSell + PlannedSell) |
| AvailableToTransfer | Integer (signed) | 8 | Max(AvailableBalance - MinimumBalance, 0) |
| Balance | Integer (signed) | 8 | The balance of the Instrument to which this Holding relates, in this Account at the time of starting the Trading Engine. The balance updates when ActualBuy or ActualSell changes (i.e. there is a trade). Or with a deposit/withdrawal (HoldingTransaction). |
| MinimumBalance | Integer (signed) | 8 | |
| UnfundedBids | Integer (signed) | 8 | |
| NettingFundsReceivable | Integer (signed) | 8 | |
| NettingFundsUsed | Integer (signed) | 8 | |
| ProjectId | String | 50 | The identifier of the specific project at the external register associated with this Holding_change record. |
| Vintage | Integer (unsigned) | 4 | A year in YYYY format. |
| ProjectType | Foreign key to ProjectType | 8 | |
| Region | Foreign key to Region | 8 | |
| Country | Foreign key to Country | 8 | |
| HoldingTransaction | Foreign key to HoldingTransaction | 8 | When Holding is updated by a HoldingTransction, this is an FK to that HT. It is of use in the MDB where we have every HoldingData tick and can identify the source of each change. |
| ReservedQuantity | Integer (signed) | 8 | |
| ReservedQuantityNoDeficit | Integer (signed) | 8 | |
| AllowHoldingReservation | Integer (unsigned) | 1 | |
| 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. |
| BCSequence | Integer (unsigned) | 8 | The sequence number of this Holding_change message in the overall broadcast sequence. |
| Reloaded | Integer (unsigned) | 1 | Set to true for change records that are generated during a normal startup from engine cache files. |
| InstanceId | Integer (unsigned) | 4 | |
| RunId | Integer (unsigned) | 4 | |
| ChangedField | One of KVPKey | 4 | |
| CreateUser | Foreign key to User | 8 | The Id of the User that created this Holding. |
| CreateTimestamp | Integer (unsigned) | 8 | The time at which this Holding was created. |
| UpdateUser | Foreign key to User | 8 | The Id of the User that last updated this Holding. |
| UpdateTimestamp | Integer (unsigned) | 8 | The time at which this Holding was last updated. |