← Back to X_TRADER® Help Library
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
Subtract Block
Subtract Block subtracts the second input from the first input
and outputs the difference
.
Operations
Order of inputs affects the outcome.
Double-Click Edit Window
Double-click on the block to bring up an edit window:
- 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
Subtract Block will either perform a subtraction or an addition
depending on the value of the Order Side Variable (see: Flip For
Sell Orders Functionality for more information). The user may alter
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
-
Example. Subtract Block with Flip For Sell Orders enabled