Trade
Overview
TT Platform
Description
Task
Browser Access
Description
Task
Videos
TT Desktop
Description
Task
Videos
Reference
Workspace Windows
Description
Task
Videos
Widgets
Description
Task
Preferences
Description
Viewing Market Data
Time and Sales
Task
Reference
Description
Depth
Description
Task
Reference
Market Grid
Description
Task
Videos
Reference
Product Grid
Description
Task
Reference
Spread Matrix
Description
Task
Videos
Reference
Basic Order Entry
TT Order Types
Description
Task
Videos
Reference
Case Studies
TT Premium Order Types
Description
Task
Reference
Order Ticket
Description
Task
Use Cases
Reference
MD Trader®
Description
Task
Videos
Reference
Order Profiles
Description
Task
Reference
Routing Rules
Description
Task
Blocktrader
Description
Task
Videos
Reference
Trading Crypto on TT
Description
Task
Videos
Reference
Trading on B3
Order Management
Order Book
Description
Task
Reference
Floating Order Book
Description
Task
Reference
Fills
Description
Task
Reference
Positions
Description
Task
Reference
Orders and Fills
Description
Task
Reference
Audit Trail
Description
Task
Reference
Audit Query
Description
Task
Reference
Account List
Description
Task
Videos
Reference
Position Manager
Description
Task
Reference
Alert Manager and Alert Viewer
Description
Task
Videos
Reference
Account & User Restrictions
Description
Task
Reference
Balances
Description
Task
Reference
TT® OMS
Care Orders
Description
Task
Videos
Reference
Lock and Release
Description
Task
Bulking
Description
Task
Videos
Stitching and Splitting
Description
Task
Combining
Description
Task
Order Passing
Description
Task
Use Cases
Order Exceptions
Description
Task
Options
Options on TT
Description
Videos
Options Chain
Description
Task
Use Cases
Videos
Reference
Options Trade Monitor
Description
Task
Videos
Reference
Vol Curve Manager
Description
Task
Use Cases
Videos
Reference
Electronic Eye
Description
Task
Videos
Reference
RFQ Viewer
Description
Task
Videos
Reference
RFQ with Counterparties
Description
Task
Counterparty Manager
Description
Task
Strategy Creation
Description
Task
Use Cases
Reference
Options Risk
Description
Task
Videos
Reference
Options Risk Matrix
Description
Task
Videos
Reference
Watchlist
Description
Task
Videos
Reference
Expiration Manager
Description
Task
Volatility Calculator
Description
Task
TT Uncovered 2.0
Description
Task
TT Uncovered 3.0
Description
Task
QuikStrike
Description
Task
Spread Trading
Autospreader
Description
Task
Use Cases
Videos
Reference
Autospreader Rules
Description
Task
Videos
Reference
Hedge Manager
Description
Task
Videos
Reference
Trading in Yield
Description
Task
Use Cases
Reference
Aggregator
Description
Task
Videos
Reference
Algo Trading
Algo Dashboard
Description
Task
Videos
Reference
Template Manager
Description
Task
Order Management Algos (OMAs)
Autotrader
Description
Task
Reference
Videos
Excel integration with TT
Description
Task
Videos
Reference
Market-Making Algos
Analytics
Charts
Description
Technical Indicators
Task
Videos
Reference
Trader Analytics
Description
Task
Reference
ADL
ADL Overview
Introduction to ADL
Description
Task
Videos
Reference
ADL Basic Concepts
Description
Task
Reference
Building your first algo
Lessons
Advanced concepts
Description
Task
Case Studies
Jump blocks
Group blocks
Virtualized blocks
Library blocks
Trading Blocks
Discrete blocks
Arithmetic blocks
Basic blocks
Logic blocks
Miscellaneous blocks
Setup
Setup Overview
Getting Started
Description
Task
Videos
Reference
Supported Order Types and TIFs
Company Administration
Connections
Description
Task
Videos
Reference
Accounts
Description
Task
Videos
Use Cases
Reference
Users
Description
Task
Videos
Reference
Company
Description
Task
Reference
Order Tag Defaults
Description
Task
Account Administrators
Description
Task
TT Premium Services
Description
Task
TT Access
Description
Task
Advanced Features
Description
Risk Management
Risk Administration
Description
Task
Risk Limits
Description
Task
Videos
Reference
Pre-Trade Portfolio Risk
Description
Task
Reference
Order Cross Prevention
Description
Task
Videos
KRM Limits
Description
Task
TT® OMS
TT OMS Administration
Description
Task
Use Cases
Reference
Exchanges: Americas
B3
Description
Task
CBOE
Description
Task
Cboe FX
Description
Task
Reference
CFE
Description
Task
CME
Description
Task
Dealerweb
Description
Task
EBS Direct
Description
Task
EBS Market
Description
Task
Fenics
Description
Task
FMX
Description
Task
FMX_USTF
Description
Task
Goldman Sachs Commodity Blocks (GSCB)
Description
Task
Referece
ICE
Description
Task
MexDer
Description
Task
MIAX_FUT_CH
Description
Task
MIAX_FUT_NY
Description
Task
MX
Description
Task
Nodal
Description
Task
NFI
Task
Exchanges: EMEA
ATHEX
Description
Task
BIST
Description
Task
DGCX
Description
Task
EEX
Description
Task
EPEX SPOT
Description
Task
Reference
Eris
Description
Task
Eurex
Description
Task
Videos
Euronext
Description
Task
GFO-X
Description
Task
ICE_L
Description
Task
JSE
Description
Task
LME
Description
Task
LME NTP
Description
Task
LSE
Description
Task
MEFF
Description
Task
NDAQ_EU
Description
Task
NASDAQ_NED
Description
Task
Nord Pool
Description
Task
Reference
WSE
Description
Task
Exchanges: Asia/Pacific
ABX
Description
Task
ASX
Description
Task
FEX
Description
Task
HKEx
Description
Task
JPX
Description
Task
NSE
Description
Task
NZX
Description
Task
SGX
Description
Task
SGX GIFT
Description
Task
TAIFEX
Description
Task
TFEX
Description
Task
TFX
Description
Task
CoinFLEX
Task
Exchanges: Crypto
Coinbase
Description
Task
Kraken
Description
Task
FIX Support
FIX Ruleset
Description
Task
FIX Sessions
Description
Task
Secondary Accounts
Description
Task
Monitor
TT Mobile
TT Backtesting
APIs
TT REST API 2.0
Getting Started
API Reference
TT REST API 2.0 (UAT)
Getting Started
API Reference
TT .NET SDK
Getting started with TT .NET SDK
Creating the application framework
Working with instruments
Subscribing for market data
More about prices
An in-depth look at the Price class
Working with orders and fills
Handling trade subscriptions
Working with trade subscriptions
Working with Algos
Algo Server
TT Order Types
TT Premium Order Types
Advanced Concepts and Options
Appendix
TT CORE SDK
Getting Started with TT Core SDK
Creating Application Framework
Working With Instruments
Subscribing for Market Data
Working with Orders and Fills
Creating a TT Application Server
Appendix
TT Trade Surveillance
Overview
Using TT Trade Surveillance
Cluster View
Core Models
Market Abuse Models
Cross Product Models
Spoofing Models
Improperly Matched Trade Models
Market Rate Models
Trading Behaviors Models
Miscellaneous Models
Configurable Models
Reports
Wachlists
Reference
TT FIX Services
TT FIX General
Getting Started
FIX Message Structure
Session messages
TT FIX Order Routing
Overview
TT FIX message conversations
Supported application messages
TT FIX Market Data
Overview
TT FIX message conversations
Supported application messages
TT FIX Drop Copy Out
Overview
TT FIX Message Conversations
Supported application messages
Compliance Feed messages
TT FIX Drop Copy In
Overview
Supported application messages
TT FIX Gateway
Getting Started
FIX Message Structure
Components
Session messages
Price Gateway Messages
Order Gateway Messages
TT FIX Recovery
Overview
FIX Recovery Methods
Supported application messages
Compliance Feed Messages
MiFID II Support

Time and Timers in TT ADL

On this page

Time and Timers in TT ADL

There are a number of scenarios where TT ADL developers may need to use time and timers in their algos. ADL provides this functionality via several blocks and mechanisms. Some of these are new in TT ADL. The following describes the use case for each.

Use Case 1: An algo needs to institute a time delay in the logical path of a discrete event.

The Stopwatch block allows users to set a time delay for a discrete event in milliseconds. The number of milliseconds is specified as an output of the associated Green Canvas so it can vary based on the logical conditions within.

One example where this may be useful is to set a delay between a fill and an additional order entry. In the algo below, the fill message is delayed 10 seconds before the quantity being fed to the Order block is increased.

Use Case 2: An algo needs to perform an action on a specific date at a specific time.

The new “AtStartTime” mode in the Generator block allows you to specify a date / time at which to signal a notification. When in the “AtStartTime” mode, you would display both the “UTCDate” and “UTCTime” connectors, which are comprised of “year”, “month”, “day”, “hour”, “minute”, “second”, and “millisecond”. When the specified UTC date and time have been reached, a discrete event will propagate from the output port.

One example where this may be useful is to update the “on/off” input port of an Order block at a specific date and time. In the algo below, the Order block is enabled until July 14, 2017 15:00:00.000 UTC.

Use Case 3: An algo needs to perform an action at a specific time every day.

The new “AtStartTime” mode in the Generator block allows you to specify a daily time at which to signal a notification. When in the “AtStartTime” mode, you would display only the “UTCTime” connectors, which is comprised of “hour”, “minute”, “second”, and “millisecond”. When the specified UTC time has been reached, a discrete event will propagate from the output port. Note that this will repeat daily.

One example where this may be useful is to update the “on/off” input port of an Order block at a specific time. In the algo below, the Order block is enabled at 3:00:00.000 UTC.

Use Case 4: An algo needs an optionally repeating discrete message notification at a given time interval.

The enhanced “TimeInterval” mode in the Generator block allows you to specify that a discrete message notification be signaled when the specified time interval has passed. When in this mode, input ports for “enabled”, “repeating”, and “periodMs” will be exposed. The “enabled” port allows the timer to be enabled / disabled, and the “repeating” port allows the event to be repeated The “periodMs” port allows the time period to be defined in milliseconds. All of these can be dynamically set.

One example where this may be useful is to update the “price” port of an Order block at specific time intervals. In the algo below, the order is repriced every 500ms to be equal to the bid.

Use Case 5: An algo needs to know the date and time at which a given discrete event has occurred.

The new MsgInfo Extractor block allows you to expose the date and time at which an event has occurred. Specifically, you would expose the “year”, “month”, “day”, “hour”, “minute”, “second”, and “millisecond” output ports. These will update every time a discrete event enters the MsgInfo Extractor block. The date / time stamp will represent the point in time that the block receives the message.

One example where this may be useful is to ensure that an Order block is enabled only if the algo is started between specific times. In the algo below, the Order block is enabled only if the algo is started between 10:00:00.000 UTC and 14:00:00.000 UTC.

Note: The Clock block available in the X_TRADER version of ADL is not part of the TT version of ADL. Although you can technically create the same mechanism in TT ADL, TT strongly advises against this as it may result in serious degradation in the performance of your algo.

So if you need to use time and timers in your algos, TT ADL provides several blocks and mechanisms to facilitate your implementation.