Automatic Order Routing

Under order routing, the routing of trading signals of a mechanical trading system to a connected broker is understood. The function can be used to:
  • Route signals of a trading system automatically to the stock exchange via a broker
  • Route signals of a trading system manually to the stock exchange via a broker
  • Test a trading system under live conditions via the demo access of a broker
Please note that the automatic order routing is not available for every data provider.

Note:
Data vendors (and 3rd party data files) may deliver erroneous data that may be represented as valid data. Data vendors may change their interface at any time and without prior notice, such an update can introduce breaking changes. Access to data from a data vendor may be delayed or fail due to network congestion, network errors, server outages, power failure and other factors.

How the Order Routing Works

To use the order routing function, a number of preferences have to be set:Several levels of automation are possible, up to fully automated trading without interference from outside.

Important: When automatic order routing is active a small routing icon will be displayed above the toolbar, to the left of the clock. This icon may be clicked to Stop All Order Routing.

Order Routing Options


Order Routing in the Tradesignal Options

Broker Accounts

A Broker Account is the terminology user in Tradesignal to refer to a connection to an account with a specific broker and associated settings. It is possible to have multiple named broker accounts to the same physical account at the same broker but with different settings. Doing so allows different strategies to be created for trading different security types with the same physical account for example.

Important: Some brokers do not provide a mechanism to take multiple manageable positions in the same security. Without this feature, it is not possible to correctly manage multiple independent strategy positions for the same security on the same physical account. Tradesignal will prevent order routing from being started if it is already active for a given security on the same physical account in such cases.
  • Add a new broker account - Accounts are added in the options menu under File > Options > Order Routing > Broker Accounts by clicking on the Add new broker account link.
  • Remove Account - Accounts can be removed by clicking the X button next to the account in the list of accounts.
  • Edit Account -Account settings can be modified by clicking on the account name listed below Order Routing under File > Options.

Configuration of the Order Routing Account


Order Routing Account Settings
In this menu, all settings for the broker account and the general handling of the orders are entered. Do not change the port number and IP address.

Selection of the Broker and name for the account are only available in the wizard when first creating the account.
  • Enter a name for the order routing account - Enter an account name that is used for this broker within Tradesignal.
  • Port - Port number of the broker's trading application, e.g. in IB TWS.
    (Please note: I you use more than one TWS on one machine, you have to change the portnumbers in the TWS. After this Enter these Portnumber here. Otherwise the orders can appear in both TWS)
  • Localhost - IP of the broker's trading application.
  • Account Code - Your account at the broker, e.g. the "Interactive Brokers Account Code" for IB.
    (Please note: The correct Account Number is only for synchonizing neccessary. The Orders will be directed to the TWS via the correct Portnumber)*Order Transmission - Select here whether the orders are routed in the Automatic or Manual mode.
  • Action on Session End - Configure here how orders shortly before the session end will be handled. They are either routed to the broker as a market order (Map Close Orders to Market Order) before session end (also see the section On-Close Order) or routed as Map Close Orders to Market-On-Close Order. In the latter case, the execution depends on the definition for this order type at your broker. A "Market Order" is routed instantly, while a ""Market on Close Order" is routed at a certain time before the session end.
  • Log Level - Here you can set the log level for details of the order processing and related tasks. The level System logs the least detailed data, the level Details the most. We recommend that you keep the default setting.
The information appears in the output window in the lower area of the window. It can be opened by a click on the grip bar.

Note:
Brokers may deliver erroneous data that may be represented as valid data. Brokers may change their interface at any time and without prior notice, such an update can introduce breaking changes. Instructions sent to a broker or access to quotes may be delayed or fail due to congestion, network errors, server outages, power failure and other factors. Broker-supplied software may be required for connection between Tradesignal and a broker. Such software may have stability issues or exhibit errors under some circumstances.

Order Confirmation


Order Verification Settings in the Tradesignal Options
In this menu, you define whether Tradesignal should send the orders automatically to the broker or if certain constraints should be applied to the order routing.

Note that in the settings of the broker account, similar settings for order routing are entered. However, those determine the behavior of the order software of the broker.
  • Manually confirm all orders - Select this option for manual confirmation of automatically generated orders. There are several settings available, some of them depending on time. The options range from indefinite waiting to order cancellation. If this is not set, orders will be automatically sent.
The remaining settings configure exceptions to manual confirmation, namely:
  • Send order cancellations without manual confirmation
  • Send order modifications without manual confirmation
  • Wait only a specific period of time to obtain manual confirmation and then take a default action:
    • Do not place order
    • Do not place order and stop order routing
    • Place the order

Initial Synchronization


Order Start/Stop Settings in the Tradesignal Options
In this menu, you can define which actions are to be undertaken during the start process of the order routing.

When starting the order routing, Tradesignal is able to synchronize the positions in the trading system with the account positions. Several options are available.
  • Do not modify the account position - Positions are not changed.
  • Modify account to strategy position with the first entry order from the strategy - The positions are only synchronized with the first entry order. This standard setting minimizes the trading costs.
  • Cancel pending orders and modify account position with the first entry order - Pending orders are canceled and the positions are synchronized with the first entry order after the start. This may cause increased trading costs.
  • Cancel pending orders and modify account position with a market order - Pending orders are canceled and the positions are instantly synchronized with an order. This may cause increased trading costs.

Stopping Order Routing

Here you can set what is to happen when the order routing is stopped.
  • Cancel pending orders - Pending orders are canceled without closing positions.
  • Cancel pending orders and close positions - Pending orders are canceled and open positions are closed.
  • Do not modify account position - Positions are not changed.

Synchronization


Position Synchronization Settings in the Tradesignal Options
Here you can define how Tradesignal will react when the account positions are no longer synchronized with the positions in the trading system. Several settings are available, from automatic synchronization with market orders to the stop of the automatic order routing with an alert.

If the account and strategy positions are no longer synchronized:
  • Cancel all pending orders and generate a market order to synchronize positions - Pending orders are canceled and a new order is issued to instantly synchronize the positions. This may cause increased trading costs, especially if the synchronization is frequently lost.
  • Cancel all pending orders, generate exit orders and synchronize with the next entry order - Pending orders are canceled, current positions are closed and new entry positions are opened. This may cause increased trading costs, especially if the synchronization is frequently lost.
  • Synchronize position on the next entry order - Pending orders remain open, and the positions are synchronized only with the next entry order issued from the trading system. The entry order is changed (increased/decreased) to include the position synchronization. Note that this can only be done with a market order or one limit/stop order. Systems with several limit orders, e.g. with limit order above and below the current quote, cannot be synchronized this way.
  • Cancel all pending orders, close account position and synchronize position with the next entry order - Pending orders are canceled, current positions are closed and new entry positions are opened. This may cause increased trading costs, especially if the synchronization is frequently lost.
  • Stop automatic order routing and notify user with an alert - The order routing is stopped (any pending orders and positions remain open).
  • Notify user with an alert - The order routing is not stopped but an alert is issued.
  • Do nothing
  • Seconds to wait for account and strategy positions to synchronize - Enter the duration in seconds that the synchronization may take. If synchronization fails, the timeout counter below starts. An out-of-sync chart will be highlighted.
  • Seconds to wait for account and strategy positions before synchronization timeout - Enter the duration in seconds before the above entered settings for handling the synchronization loss are applied.
Note: If the Send On-Close orders a few minutes before session end option is enabled, the position sizes will not be checked within the specified number of minutes before session end. As soon as the session is closed, Tradesignal will continue to check the position sizes in order to ensure the strategy and account positions are synchronous.

Stop and Limit Order

Tradesignal offers you two methods for how generated stop or limit orders are to be treated at the session end. These options determine how much the back test results may differ from real trading results.
  • Wait for Tradesignal to report a fill then send as a Market Order - Tradesignal issues a stop or limit order only after the last order was confirmed as filled by the broker.
  • Send the order to the broker as-is; take no actions if the order is not filled as expected - Tradesignal issues stop or limit orders independently of fill confirmations.
  • When using the IB TWS, this option should be deactivated. When the option is deactivated, the existing stop or limit orders are updated at every new bar/tick in Tradesignal. If the option is active, all existing orders are canceled and new orders are issued. This may result in problems, especially for fast-trading stocks or futures, as the orders cannot be canceled quickly enough by the trading software.

    On-Close Orders

    Here you can define how an order is routed when it is classified as "on-close" by the trading system.
    • Send on-close orders at the end of the session
    • Send On-Close orders a few minutes before session end - Select this option if the on-close order is to be issued before the set session end. You can enter a time in Number in Minutes or click on the spin buttons. Please note that you can set similar order routing settings in the account settings of the broker. If your broker supports real on-close orders, you may be able to send them right at the session end.
    • Cancel active limit and stop orders after on-Close orders are generated - Select this option if unfilled stop or limit orders are to be canceled when an on-close order is generated. This will keep the system from accidentally filling several orders.

    Time-in-force

    • Orders should stay active until canceled - If selected, the order may stay active for longer than the trading day.
    • Orders should stay active for the trading day - If selected, the order is only active for the current day and deleted at session end, if not filled.
    • Always generate new orders when a bar opens - Select so that pending orders are canceled and new orders are generated at each new bar. This option should not be used for short time periods, but may make sense for trading systems with long periods, e.g. weekly.

    Symbol Mapping


    Symbol Mapping
    "Symbol Mapping" in Tradesignal means mapping the symbols of the online data provider and the broker that refer to the same underlying instrument.

    For the order routing to work, the program has to know this mapping. The correct settings are very important for trading.

    Attention: If the wrong symbols are entered or mapped here, the wrong symbol may be traded by the broker in the worst case.

    Editing Symbol Maps

    • New - Enter a new symbol map. A dialog opens, see next section.
    • Edit - Edit the selected symbol map.
    • Delete - Delete the selected symbol map.
    • Delete All - Delete all symbol maps.

    Configuring Order Routing Symbol Mapping


    Order Routing Symbol Mapping Dialog
    In this dialog you can create a new symbol map or edit an existing map.

    Enter the symbol from the data provider:
    • When a chart with a symbol is open and selected, this symbol is automatically entered here. Otherwise, click on the Browse button to start the symbol search in Tradesignal. Note that many symbol names are a combination of symbol shortcut and exchange name.
    Enter the symbol details for the broker:
    • Underlying - Enter the asset's underlying ticker symbol.
    • Exchange - Select the exchange from the list at which the symbol is traded.
    • Security Type - Select the symbol type from the list. Most brokers use this setting to assign the shortcut to the right exchange.
    • Currency - Select the currency delivered against the purchase of the underlying currency.
    • Expiry Date - Enter an expiry date for the underlying, if available.
    Attention: Please check the settings to ensure that the right symbols are ordered.

    Order Routing Toolbar


    Button Menu Order Routing
    Open this toolbar by clicking on the Order Routing tab above the toolbar.
    • Start Automatic Order Routing - Start the order routing for the selected chart or portfolio. To start all order routings, press the Ctrl key while clicking.
    • Stop Automatic Order Routing - Stop the order routing for the selected chart or portfolio.
    • Stop All Automatic Order Routing - Stop the order routing for all charts and portfolios.
    • Order Routing Options - Opens the Order Routing Options in the Tradesignal Options.

    Strategy Automation Options


    Automatic Order Routing Menu
    This menu is opened by clicking on the small plug symbol on the lower right of the chart or a portfolio. Here you can activate different levels of automation for the order routing. The following settings are available:
    • No Order Routing: Select this option if no automatic order routing is used. No signals are output by the strategy. The Position Manager remains empty.
    • Position Manager Only: Select this option to send the signals generated by the strategy to the Position Manager. To submit the orders, you have to enter them manually into your broker's order software.
    • Broker: Select this option to route the orders automatically. The signals of the trading system are displayed in the Position Manager and also routed to the broker. The limitations for this automation are set in the Order Verification settings of the Order Routing Settings in the Tradesignal Options, see above.
    After selecting an option, you can start the order routing from the Order Routing button menu. Click on the Start Automatic Order Routing entry.

    Controlling how and when orders get filled

    When using order routing the one of the major issues is ensuring that fills generated in the strategy closely match fills in the brokerageaccount. The Money Management property Realtime Price Source can be used to tell Tradesignal to use best bid and best ask prices from the Broker instead of using last prices from the data source. The following settings are available:
    • Bid/Ask - Tradesignal uses the best bid / best ask data provided by either the broker (if an order routing module has been connected) or the data provider. If neither the broker nor the data provider is delivering bid/ask prices, Tradesignal uses the last price instead (for example in the case of indices). Best bid and best ask prices are generated when a market participant wants to buy or sell a number of shares/contracts while a last price represents an actual trade that has been made. Therefore this option has the benefit of more accurate fills for your orders. The caveat is however that the results collected in real time will not match the results of back-testing which will always only use the last price.
    • Last - Tradesignal uses the last price delivered by the data provider. This is the same price as the one used to back-test the strategy. A last tick represents a trade that has been made in the market. When using this mode, Tradesignal can only fill and order after a trade has been made, even if there was a matching offer/request in the market prior to the trade. This mode ensures that real time results are closer to back-test results.