ADL®

Round Block

The Round Block rounds an numeric input based on the increment input and mode setting; it then outputs the rounded value.

Example Round a value to the nearest tenth using AlwaysDown and Normal modes.

To access the block settings, double-click the block.

More about Flip for Sell

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 Round block changes as shown.

Block settings

To change default block settings, double-click the block to open the Block Editor.

Setting Description
Name Name to display beneath the block on the ADL canvas
BodyColor Background color of the block
Mode

Rules to use for rounding the input value:

  • Normal: Use standard rounding rules (n < 5, round down; n >= 5, round up)
  • AlwaysDown: Round to the lower increment
  • AlwaysUp: Round to the upper increment
Description Optional text to explain how the block is used