Understanding the granular order in which the variables are updated is one of the most crucial elements in mastering advanced programming techniques in ADL.
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 ADL rules govern the exact order in which the blocks are updated as a discrete event message propagates:
During the propagation, when a discrete event message enters a Pass-Through Block (i.e., any block which receives and passes on a discrete event message unchanged):
Example Order of updates upon entering a “pass-through” block. This example shows how the discrete event message will first update the blocks connected "downstream" from the pass-through block before exiting the pass-through block.
A discrete event message propagates along its path as far as possible and terminates upon entering any one of the following blocks:
Example Termination point