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
Position in Queue (PIQ)
Time and Sales
Description
Task
Reference
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
TT FX
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
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

Building the entry logic

On this page

The first part of building the Scalper algo is to define the entry order. This portion of your algo places a buy order for a specified quantity at the best bid of the defined instrument.

Starting an entry order with the Order block

The Order block enters orders into the market. Place an Order block on the Canvas to be used to submit the entry order:

  1. From the Blocks panel, click and drag the Order block on to the ADL canvas.

    Add pic

    Once placed, the Order block will be highlighted yellow to indicate that it is the currently selected block. In the Block Properties panel, you can view and edit the properties for the highlighted block.

  2. In the Blocks Properties panel, specify the following properties.
    • Specify a Name of Entry Order to make it easier to identify the block.
    • Set Type to Limit
    • Set Side is Buy
    • Set TIF is Day.

    You should see the block name appear under the Order block in the canvas.

  3. Note the messages in the Problems tab of the Information Panel indicating that the Order block you just placed is missing input connections. As you add more blocks and connect them to the Order block, these messages will disappear.

Selecting an instrument with the Instrument block

Now that you have an order block, you need to select an instrument you want to trade. The Instrument block lets you select the instrument you want to use. In this algo, you will select a default contract, the front-month e-Mini S&P on CME, but will also allow a user to choose a different contract when launching the algo.

To define the instrument for our entry order:

  1. From the Blocks panel, double-click the Instrument block and then arrange it within the ADL canvas.

  2. In the Block Properties panel, specify the following properties.
    • Give the block a Name of Instrument.
    • In the Instrument field, specify the default instrument for the algo. In this example, you want to use CME’s front-month e-Mini S&P contract.
    • For the Type property, select User-defined which will allow the user to choose a different contract when launching the algo.
    • Select an Account in the SIM environment which has:

      • Been assigned to your login.
      • User permissions to run in ADL.
      • Account permissions to run in ADL.
      Instrument block properties panel

      You can now see the selected Instrument displayed next to the blue instrument output port.
      Instrument block properties panel

    • To set the instrument for the entry order, connect the Instrument block to the Entry Order block by clicking and dragging the left mouse button from the Instrument block’s output port to the Entry Order block’s inst input port.
      Instrument block properties panel

      Notice that the first problem message regarding an invalid instrument is now gone, leaving two remaining problems.

Setting the order price with the Field block

Next, set the price of the entry order at the best bid for the selected instrument. This algo uses a Field block to receive instrument data from the Instrument block, continuously extract the Best Bid price of the instrument, and provide that value to the price port of our Entry Order block.

To place the Field block and make the necessary connections:

  1. You can use the Search feature to simplify the process of locating and pre-populating blocks. From the Blocks panel Search field, type “bid“.

    Notice how the list of blocks in the panel includes only those blocks whose names or properties that contain the string, “bid.”

  2. From the Blocks panel, click and drag the Field (bidPrice) block on to the ADL canvas.

    Notice that a new problem was added to the Problems tab of the Information Panel, indicating an issue needs to be resolved.
  3. In the Blocks Properties panel, specify the following properties.
    • Notice that the Field Name drop-down is already selected as the result of block search.
    • Set Name to Best Bid.
    • Ensure that the Lookup Type is Best.

  4. To use Edge Finder to more easily connect blocks, press and hold the Shift key to display dashed lines for suggested connections from the Instrument block to the Field block and from the Field block to the price port of the Order block.

  5. While holding the Shift key, either left-click each of the two dashed lines to make the connections, or right click one of the dotted lines to create both edges at once.

Setting the order quantity with the Number block

To define the entry order quantity, the algo uses a Number block. You will set a default value of 5, but allow the user to specify different quantities when running the algo.

To place the Number block and make the necessary connections:

  1. From the Blocks panel Search field, type 5.

    Notice how the panel automatically shows a Number block with its value already set to 5.

  2. Click and drag the Number block on to the ADL canvas.

  3. In the Blocks Properties panel, specify the following properties.
    • Notice that the Default Value drop-down is already set to 5, as the result of block search.
    • Set Name to Entry Order Qty.
    • Set Variable Type to User Defined which will allow the user to provide an order quantity other than the default of 5.
    • If desired, you could also use Max Value and Min Value to prevent users from accidentally submitting unreasonable order quantities.

  4. Connect the Number block to the qty input port of the Order block.

    After connecting the blocks, you have addressed the last of the problem issues, so the Problems tab is now blank.

You have now finished the entry order portion of your algo which will place a 5-lot order at the best bid for the instrument defined by the Instrument block. The next step is to test this portion your algo.

Cookie Settings

We use cookies to analyze the usage of this site, personalize your digital experience and serve you tailored advertising content. You may accept or opt-out of the use of certain cookies. Essential cookies are always active because they are required to provide the basic functionalities of the site. By clicking “[Accept All],” you grant us permission to use and disclose information about you and your interactions with this site to our third-party analytics and advertising partners. You may withdraw your permission at any time by clicking “[Cookie Preferences]” at the bottom of our website and selecting “[Reject All].” If you withdraw your permission, your digital experience and advertising content may not be personalized or targeted to you directly. You may also reject some types of cookies, which may impact your experience as certain features on our site may be unavailable. For more information about our use of cookies or our privacy practices, please review our Cookie Policy and Privacy Policy.

Strictly Necessary Cookies

These cookies are required for our website's basic features and technical functions. These cookies save information required for the website to function properly and cannot be turned off. These include cookies used for website security, website technical statistics, and site features.

Performance Cookies

These cookies enable us and our third-party analytic partners to analyze site traffic, user navigation and user engagement. These include cookies that analyze number of unique website visitors and their interactions with our website.

Targeting Cookies

These cookies enable us and our third-party advertising partners to build profiles of website visitors, show them targeted advertisements tailored to their interests, or track the effectiveness of advertising campaigns.