The Add Block adds the first input number and the second input number and outputs the sum.
Example Use the Add Block to add 2 to the fill quantity.
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 Add Block will either perform an addition or a subtraction depending on the value of the Order Side Variable (see: Flip For Sell Orders Functionality for more information).
When you enable Flip for Sell, the appearance of the Add Block changes as shown.
Note If you enable Flip for Sell, the order of the inputs matter because it subtracts the two inputs when flipped.
As an illustration, the previous example might produce undesired results if you enable Flip for Sell. In the Add block, the first input is 2 and the second input is the fill quantity. If flipped, the Add Block would subtract the fill quantity from 2, which is probably not the intended behavior. If you plan to enable Flip for Sell, you likely want to configure the Add Block as follows.
Example Arrange inputs to work when flipped.
To change default block settings, double-click the block to open the Block Editor.
|Name||Name to display beneath the block on the ADL canvas|
|BodyColor||Background color of the block|
Whether to enable a single algorithm to act either as buy or sell side routine as needed
See Flip For Sell Orders Functionality for more information.
|Description||Optional text to explain how the block is used|