During the execution of an automated strategy, ADL will continuously send and receive information from an exchange server. In ADL, every piece of information is characterized as either a Continuous Message or a Discrete Event Message.
Continuous messages represent information that is continuously disseminated by an exchange. For instance, the bid quantity available at a specific price level is considered to be a continuous message, as this information is essentially a continuous stream of data available at all times.
Continuous messages from an exchange are channeled into an algorithm through few designated blocks such as the Instrument Field Block. Other downstream blocks may use these channeled continuous messages to produce continuous outputs of their own. Such continuous outputs flow through an algorithm via Numeric, True/False, Instrument or Variable ports.
Example The Instrument Field Block channels a stream of continuous data from an exchange.
Discrete event messages represent information disseminated from or submitted to an exchange for occurrences of market events that happen at a single moment in time (denoted as Discrete Events). For instance, a Fill Confirmation message from an exchange server is considered to be a discrete event message, as this information is a pulse of data disseminated only at the moment of an order execution.
The following market events are considered to occur at a single moment in time:
Several designated blocks, such as the Order Block, may exchange discrete event messages directly with an exchange. When a block submits or receives a discrete event message, it will distribute a copy of the message throughout the rest of the algorithm in the form a single pulse. A discrete event message may flow through an algorithm via discrete event message ports.
Example The Order Block is one of several designated blocks in ADL which can submit and receive discrete event messages from an exchange server.
Several blocks which do not interact directly with an exchange can also send a pulse of discrete event message throughout an algorithm at user-defined moments. However, since such discrete event messages are not associated with any real requests or confirmations, these messages are void of information and merely provide the function of triggering downstream blocks to perform an action at user-defined moments (e.g., resetting a block's continuous output values).
Discrete event messages have a key characteristic: when a block outputs a pulse of discrete event message, an algorithm temporarily stops channeling continuous messages from the exchange servers. Continuous message channels will remain closed while the pulse of discrete event message propagates throughout the algorithm. In effect, this behavior will "freeze" the output of blocks such as the Instrument Field Block which channels streaming market data. In this static state, the pulse of discrete event message will traverse the pathway designed by the user, updating the output values of the blocks which lie in its path. Once this propagation is complete, the algorithm will resume channeling continuous messages from all exchange servers.
Note that such propagation takes place within microseconds and will not be perceivable in practice. With this mechanism, however, ADL allows the user to capture and use the market data existing precisely at the moment of a discrete event.
The following is a simplified illustration of this mechanism in effect:
The diagram below shows an example of an Instrument Field Block (yellow block on the left) channeling a continuous numeric value into the Order Block (blue block on the right). The Instrument Field Block channels the best bid price of an instrument specified by the user, and the Order Block uses this streaming data to quote buy orders at the best bid price for the specified instrument with the specified quantity (instrument and quantity inputs are not shown in the illustration).
When one or more of the quoted orders are executed, the Order Block receives a Fill Confirmation message from the exchange server and outputs a discrete event message in the form of a single pulse. At this time, the algorithm stops channeling continuous messages from the exchange server. The pulse of discrete event message propagates through the algorithm, following the pathway designed by the user. It updates the output values of the blocks which lie in its path.
Once the propagation is complete, the algorithm resumes channeling continuous messages from the exchange server.