Status and Functional Control

MarketGrid uses the concept of Status to impact the temporary state and long term lifecycle of the different entities of the MarketGrid data model.

Every entity (an object defined as an Entity, Static or Change table) includes a field called Status that represents a set of the values in the Status enumeration. This set is normally represented as a bit mask when implemented in the various MarketGrid components that use them.

Lifecycle Status

Whilst many of the specific values are used to control functionality for a subset of entities in the system, the values;

  • Active
  • Normal
  • EngineOnly
  • Released; and
  • Hidden

are used to manage the lifecycle of records. In particular this includes the Active and Normal values which control whether a record is "deleted" (Active missing or unset) or "suspended" (Normal missing or unset).

Status as displayed on the UI

The phrases used for Status in the UI are simplified as per the above sentiment, so that they are more easily interpreted by the user. The following table explains the UI phrasing criteria for Status:

UI Status PhraseUnderlying Status valueDescription
DeletedNot ActiveA record without the Active bit set is marked as Deleted, and will be removed from the database at the next Shared Memory Refresh
SuspendedActive
Not Normal
A record that is Active but not Normal is marked as Suspended
HiddenActive
Normal
Hidden
A record that is not Deleted or Suspended with the Hidden bit set will be hidden from view in the UI
TerminatedActive
Normal
Terminated
A record that is not Deleted or Suspended with the Terminated bit set is marked as Terminated (related to Sessions/Auctions)
ClosedActive
Normal
Closed
A record that is not Deleted or Suspended with the Closed bit set is marked as Closed
ActiveActive
Normal
Not Hidden
Not Closed
A record that is not Deleted, Suspended, Hidden or Closed will be marked as Active

Trading Behaviour

Generally speaking when performing trading activity, the system will validate that the entities involved are "Active" (ie not "Suspended", "Closed" nor "Deleted"). The specific entities checked are dependent on the activity in question. For example for Order management, the system will validate;

  • InstrumentMarket - and the Product hierarchy via WorkingStatus
  • User - and the Actor hierarchy via WorkingStatus
  • Account; and
  • ExternalAccount

Functional Status

In addition to the Lifecycle Status values, the other Status values are used to control functional behaviour across the system. At a high level, certain behaviours require the target object to have a particular Status value set before that behaviour is permitted. For example, an InstrumentMarket must have the Status.BuyOrdersAccepted value set before anyone can enter Buy Orders for that InstrumentMarket. The various functional Status values are described in the Status enumeration documentation.

Working Status

The WorkingStatus of an object in MarketGrid is the "net" effect of all the Status values of the instances to which it is connected. Where the net effect is determined in the following ways.

Product

For any member of the Product hierarchy, anytime the Status of changes, that change is propagated to all the InstrumentMarkets under that, say, Market and the WorkingStatus of that InstrumentMarket is updated according to the rules about which elements supercede which.

When the system processes a change in Status for an instance of the Product hierarchy the system iterates over all the InstrumentMarkets subordinate to that instance and recalculates the WorkingStatus for each of them.

Starting at the topmost level, the System, which is implemented as a special case of Venue and then iterate over the model hierarchy for which the Status change is applied in the following sequence;

  • Start with the WorkingStatus of the Venue
  • apply in turn, the Status (note not the WorkingStatus) of the;
    • Market,
    • InstrumentGroup,
    • Instrument; and finally
    • InstrumentMarket

At each step of the hierarchy, the calculation of WorkingStatus consists of the Status values in common with the previous step (ie the parent instance) plus the values;

  • Released
  • Hidden
  • Closed

where either the current Status or the currently calculated value has the value set. In other words the end result is effectively the values in common accross the hierarchy, plus any of; Released, Hidden, Closed where one of the hierarchy has that value.

Actor

For any member of the Actor hierarchy, anytime the Status of changes, that change is propagated to all the Users under that member. That is;

  • Enterprise - apply the Status change to all member Firms
  • Firm - apply the Status change to all member Users
  • User; or

When a User ends up "Suspended" or "Deleted" then any active connection from that User is disconnected by the system.

Position Keeping

Accounts, ExternalAccounts and other elements of the Position Keeping model do not use WorkingStatus since their Status is not inherited from their parent entities Status values.