ADL® Documentation
- Fundamental Concepts
- ADL Learning Guide
- Basic Blocks
- Trading Blocks
- Discrete Blocks
-
Miscellaneous Blocks
- Round Block
- Display To Decimal Block
- Formula Block
- Average Block
- Stopwatch Block
- Clock Block
- Note Block
- Random Number Block
- Pause Block
- Log Block
- IsNumber Block
- Once True Always True Block
- Not Block
- Loop Block
- Exit Block
- Risk Block
- Workup State Block
- Alert Block
- Math Block
- Actor Blocks
- TT Analytics Block
-
Advanced Concepts
- Sniper Algo
- Order of Discrete Event Message Propagation
- Grouped Blocks and Library Functionality
- Rules Of Virtualization
- Jump Blocks
- Safety And Preventive Design With Visual Feedback
- Flip For Sell Orders Functionality
- Dynamic Data ExchangeLink
- Leave Orders On Pause Or Cancel
- Creating and Launching Order Ticket Algorithms (OTAs)
- Breakpoint Functionality
- Algorithm Behavior At Market Close and Disconnect
- Exporting Block Output Values
Discrete Order Block
When a discrete event message triggers the Discrete Order Block, it
submits a “one-shot” order for the specified instrument
at the price and
quantity specified by the user (specified by double-clicking on
the block).
Recommended
Tutorials For This Section
For a tactile learning experience, please try the following tutorial:
-
Discrete Order Block
Operations
- As the generated order is a "one-shot" order, the Discrete Order Block will not update the working order to reflect any changes in the inputs after the initial submission – however, the block will delete the working order when the user pauses or stops his algorithm. In addition, the block will not resubmit when the generated order is automatically or manually deleted.
- A discrete event message
is generated from the Add Ok output upon receiving an order add confirmation.

Using Single Order Container in conjunction
- The Discrete Order
Block can be used with the Single Order Container as follows: when
the Discrete Order Block successfully generates an order, the block
will output a discrete event message
.
- If the user connects this message to the input of a Single Order Container, the Container will take complete control of the generated order until the order is filled or deleted by the Single Order Container, or if a new order is generated by the Discrete Order Block.
Note: The Single Order Container can only manage a single order at a time. If the Discrete Order Block generates a new order while the Single Order Container is occupied, the Container will be forced to forfeit the control of the current order in order to accept the new one.
Example. Using Single Order Container in conjunction
Virtualizing Single Order Container and Multiplexer
The Single Order Container can only manage a single order at a time. When the container is overloaded with more than a single order, it will forfeit the control of its current order to accept a new one. Such overloading can occur when a Discrete Order Block is triggered by multiple discrete event messages, thereby generating and passing multiple orders to its respective order container.
Example. Overloading a Single Order Container
In order to prevent this undesirable behavior, the user can virtualize the Single Order Container and its respective Multiplexer (see: Virtualization for more information). With this setup, a new copy of the Single Order Container will be generated every time the Discrete Order Block generates and submits a new order. Each copy of the order container will manage a single order with unique price, quantity, and delete condition inputs.
Example. Virtualizing a Single Order Container
Manually modifying an order controlled by the Single Order Container
If the user manually deletes or modifies an order managed by the Single Order Container, it will relinquish control over to the user, but discrete event messages will still be generated from the appropriate output ports at the expected times. If the user pauses and then resumes the algorithm, the Single Order Container will attempt to re-locate its managed order and re-take control. If it cannot locate the order, the container will simply await a new order.
Double-Click Edit Window
Double-click on the block to bring up an edit window:
- Clicking on the formula
link will display a green canvas where the user can specify the
Price, Quantity and the Conditions that define the "one-shot" order
which will be submitted by the Discrete Order Block when it is triggered
by
.
- Leave Orders On Pause or Cancel: When this option is checked, orders generated by the Discrete Order Block remain in the order book even if the algorithm is paused or canceled. A paused state can result from a client side connection drop.
-
Flip for Sell Orders: Many automated strategies in ADL will have nearly identical buy and sell side routines, with certain blocks acting as "pivot" points. To enable a single algorithm to act either as buy or sell side routine as needed, several blocks in ADL will have the option "Flip For Sell Orders." This option enables them to perform an alternate function depending on the user's selection of the Order Side Variable (either BUY or SELL). The Order Side Variable will appear automatically for any algorithm containing a block with the "Flip For Sell Orders" functionality enabled, and the user must set this variable prior to launching an algorithm. When this functionality is enabled, the Discrete Order Block will submit either buy or sell orders depending on the user's selection of the Order Side variable (see: Flip For Sell Orders Functionality for more information). The user may alter the value of the Order Side Variable through one of the following three methods:
- Using the
drop-down menu located at the top portion of the Designer canvas
- Using the Variables Tab on the Algo Dashboard
- Using the MD Trader window: Clicking on the bid side column (blue column) will set the Order Side Variable to "BUY," and clicking on the offer side column (red column) will set the Order Side Variable to "SELL." This method applies to Order Ticket Algorithms only (see: Creating and Launching Order Ticket Algorithms for more information).
- Using the
- Tag: This text box allows the user to tag the orders generated by the Discrete Order Block with custom text which will appear in the “Order Tag” column of the Order Fills Window. By assigning text to each order, you can quickly sort and filter orders on the Order Fills Widow by using the Order Tag column.
- Order Flag Color: The color of the order flag to be displayed within MD Trader. Select white to disable flag color.
Internalized Logic Canvas
Internalized Logic Canvas: Several blocks in ADL contain an internalized logic canvas which can be accessed by double-clicking on the block.
Example. Internal Logic Canvas
The canvas is used to define user-made equations which will play an important role in the overall operation of the respective block. The following icons can be dragged onto the green canvas to define an equation:
: These icons can be linked to define an arithmetic equation or a True/False statement.
: The Block Value Icon allows the user to reference the output of any other block in the algorithm. When dragged onto the canvas, the Block Value Icon will display a menu from which the user will be able to choose a block within the algorithm (except for the blocks contained in a virtualized block).
-
: The Message Info Icon allows the user to extract certain information embedded within a discrete event message, such as a Fill Confirmation Message. When dragged onto the canvas, the Message Info Icon will display the following selectable fields:
Field Description Limit The price of the respective order or the order about to be submitted OrderQty The total order quantity of the respective order or the order about to be submitted WorkingQty The working quantity of the respective order or the order about to be submitted FillPrice Fill price FillQty Fill quantity Instrument Instrument of the submitted order ExeQty Total filled quantity of the respective order DisclosedQty The disclosed quantity or percentage (%) of total goal quantity viewable to the market DeletedQty The canceled quantity of the deleted order or the order about to be deleted IsBuy When this field is selected, the respective block will evaluate the user's fill confirmations messages (not trade data message disseminated by the exchange) and will output a Boolean value of TRUE if the user's fill was a buy side execution StopTrigger The price at which the respective stop-limit or stop-market order is activated TradeQty Quantity of the last trade for a specific instrument TradePrice Price of the last trade for a specific instrument IsQuotingOrder Applies to discrete event messages generated by an ASE Order Block. The field will output a Boolean value of TRUE if the message was generated from an order submission for the quote leg of the respective spread IsHedgeOrder Applies to discrete event messages generated by an ASE Order Block. The field will output a Boolean value of TRUE if the message was generated from an order submission for the hedge leg of the respective spread User Field 1 - 4 An empty field that can be populated with a value using a Value Injector Block. The value may then be extracted using a Value Extractor Block