ADL®

Field Block

The Field Block retrieves market data, such as AskQty or Volume, for a connected Instrument Block. You can use these values as inputs to other blocks, such as an Order Block or a logical block.

The following example gets the Ask and Open prices for the CL Jan16 instrument and feeds their outputs to a Greater Than Block to determine whether the market moved up since the opening.

Example Get price market data

More about lookup types

Several attributes will inevitably vary at different depths of the market (e.g., bid quantity). For such attributes, you can specify a market depth to retrieve the attribute at that price level. This field allows your to choose a method of specifying a market depth for applicable attributes:

  • Best. When this option is selected, the block returns the value at the inside market.

  • Index. When this option is selected, the Field Block exposes an additional port, as shown in the illustration below. The user may feed a numeric value into this port to specify a price level.

    Example Index lookup type

    Note Keep in mind that the Index count does not take into account the price levels where the selected attribute is zero. For instance, the following illustration shows the first three index levels of the Bid quantity for the ZB Sep16 contract. In addition, when the provided index is negative or goes beyond the existing market depth, the block will output a zero for quantity-related attributes and a NaN (Not A Number) for price-related attributes

  • Price. When this option is selected, the Field Block exposes an additional port, as shown in the illustration below. The user may feed a numeric value into this port to specify an index level. The index level is defined as the number of "ticks" away from the best bid/offer, taking into account only the price levels where the selected attribute is non-zero.

    Example Price lookup type

More about Last Traded Quantity (LTQ)

LTQ can be displayed as accumulated or unaccumulated. Unaccumulated LTQ is simply the most recent LTQ. Accumulated LTQ is a summation of all LTQs that occur at a given LTP while the LTP remains unchanged. For example, consider the following trades:

LTP = 100, LTQ = 3
LTP = 99, LTQ = 4
LTP = 99, LTQ=7
LTP = 99, LTQ=1

At this point, an unaccumulated LTQ would be displayed as 1, while an accumulated LTQ would display as 12 (4+7+1).

In TT, the Trade app displays accumulated LTQ. However, TT ADL displays unaccumulated LTQ. If desired, ADL designers can calculate the accumulated LTQ as follows.

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 following pairs of attributes will alternate depending on the user's selection of the Order Side Variable.

  • Bid Price / Ask Price
  • Bid Qty / Ask Qty
  • High / Low
  • Direct Bid Qty / Direct Ask Qty
  • Bid Orders Qty / Ask Orders Qty
  • Direct Bid Price / Direct Ask Price

When you enable Flip for Sell, the appearance of the Field Block changes as shown.

For more information, see Flip for Sell Orders Functionality.

Market data fields

Field name Description

AskOrderCount

Number of ask orders at the specified market depth including the user’s offers (ask orders at the best ask price if depth is not provided)

Note The Instrument Field Block will output a zero value if this field is unsupported by the exchange or when the market is empty. TT or the exchange can verify if this field is supported.

AskPrice

Ask price at the specified index level (best ask price if depth is not specified)

AskQuantity

Ask quantity at the specified market depth including the user’s offers (ask quantity at the best ask price if depth is not specified

BidOrderCount

Number of bid orders at the specified market depth including the user’s orders (bid orders at the best bid price if depth is not provided)

Note The Instrument Field Block will output a zero value if this field is unsupported by the exchange or when the market is empty. TT or the exchange can verify if this field is supported.

BidPrice

Bid price at the specified index level (best bid price if depth is not specified)

BidQuantity

Bid quantity at the specified market depth including the user’s bids (bid quantity at the best bid price if depth is not specified)

ClosePrice

Price at market close

DirectAskPrice

Ask price at the specified index level, taking into account only the levels where there is at least one non-implied offer (if depth is not specified: lowest ask price where there is a non-implied offer)

DirectAskQuantity

Non-implied ask quantity at the specified market depth (if market depth is not provided: non-implied ask quantity at the lowest ask price where there is at least one non-implied bid)

DirectBidPrice

Bid price at the specified index level, taking into account only the levels where there is at least one non-implied bid (if depth is not specified: highest bid price where there is a non-implied bid)

DirectBidQuantity

Non-implied bid quantity at the specified market depth (if market depth is not provided: non-implied bid quantity at the highest bid price where there is at least one non-implied bid)

HighPrice

Highest traded price during the current trading session

ImpliedAskQuantity

Quantity available at the implied ask price

ImpliedBidQuantity

Quantity available at the implied bid price

LastTradePrice

Last traded price

LastTradeQuantity

Last quantity traded at the last traded price. For more information about accumulated and unaccumulated LTQ, see More about last traded quantity (LTQ)

LowPrice

Lowest traded price during the current trading session

MinPriceIncrement

Minimum tradable increment for the specified instrument

MinTickIncrement

Minimum achievable tick increment for the specified instrument

Note A single instrument could have differing Minimum Price Increment and Minimum Tick Increment. For example, an outright S&P 500 E-mini contract has a Minimum Price Increment of 25 (because it trades in an increment of 25), but it has a Minimum Tick Increment of 5 (because an E-mini spread trades in an increment of 5).

OpenPrice

Price at market open

SettlePrice

Settled price from the previous trading session

Volume

Volume traded during the current trading session

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
FieldName

Market data field value to extract

LookupType

Price level to use for the value

The following lookup types allow you indicate a market depth to use:

  • Best: Inside market
  • Index: Number of price levels away from the inside market
  • Price: Specific price at which to retrieve the value (not all fields support this type)
FlipForSell

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