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.

Order Routing Options


Order Routing in the Tradesignal Options

Default Settings

  • Order Bar Location - Select whether the order bar should be displayed at the top or at the bottom of the screen.
  • Increment Quantity - Enter an increment size for the numbers in the order bar.
  • Increment limit and stop price according to the instrument tick size multiplied by the factor 1-100 - This number determines how much the value increases or decreases when clicking on the spin buttons for the stop and limit entry fields.
  • Generate warning if total cost of order execution exceeds this value - Select the option and enter a value if you want to receive a warning in case of overly high order costs.
Broker Module
  • Trading Extension DLLs - Displays the folder for the DLLs files used for trading. Normally you should not change the selected folder.

Accounts

  • New - Enter a new account/broker. This rarely has to be done. For details, see the section Configuration of the Order Routing Account.
  • Edit - Edit the selected account.
  • Delete - Delete the selected account.
  • Symbol Map - Here you can set up the symbol connections, which define the connections between the symbols of your data provider and your broker. For details, see the section Symbol Mapping.

Order Verification


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.

Orders sent manually from the Order Bar

Show confirmation dialog when placing an order ? Select whether even for manually entered orders, a confirmation dialog is to be displayed (Always) or not (Never).

Orders generated automatically by a trading system

  • Automatically send all orders to the broker without manual confirmation - Select this option for no manual confirmation. This way, the order routing is really automatic.
  • Manually confirm all orders before sending them to the broker - 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.
  • Wait indefinitely for manual confirmation
  • Automatically place order after a few seconds
  • Do not place order after a few seconds
  • Do not place the order and stop trading after a few seconds
Seconds to wait for manual confirmation - Enter the time span after which the order is to be placed or discarded (depending on the settings above), when the confirmation dialog is not confirmed. Enter a number or click on the spin buttons.

In the two checkboxes at the bottom of the window, you can set whether orders that are changed or canceled by the trading system are to be manually confirmed.
  • Automatically confirm order modifications - Select this option if any change orders are to be routed automatically, i.e. no manual confirmation is necessary.
  • Automatically confirm order cancellations - Select this option if any cancel orders are to be routed automatically, i.e. no manual confirmation is necessary.

Start/Stop


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

Synchronizing trading system and account when routing is active

When starting the order routing, Tradesignal is able to synchronize the positions in the trading system with the account positions. Several options are available.
  • 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.
  • Do not modify the account position - Positions are not changed.

Action to take when routing is disabled

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.

Position 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.
  • 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.
  • 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.

Order Generation


Order Generation Settings in the Tradesignal Options
Here you can define the various ways orders are to be handled at the session end, whether pending orders stay valid and whether stop or limit orders are to be routed. The window is divided into three parts.

On-Close Order

Here you can define how an order is routed when it is classified as "on-close" by the trading system.
  • 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.

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.

    Time in Force

    • Orders should stay active until canceled ? If selected, the order may stay active for longer than the trading day.
    • Order 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.

    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.
    • Pick a broker to route orders to... - Select a broker from the list.
    • Enter a name for the order routing account - Enter an account name that is used for this broker within Tradesignal.
    • Enter a nickname for the order routing account (max. 8 characters) - Enter an identifiable shortcut for the broker.
    • 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.

    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 Bar

    The order bar is displayed above or below the chart, depending on your settings in the Tradesignal options. Via the order bar you can manually send orders to your broker. For this, an active connection to your broker is necessary.

    The order bar structure is as follows:
    • Symbol - Here you can enter the symbol name. You can also enter a search term and select the symbol in the search window.
    • Name - Here the full symbol name is displayed. In addition, the currency and the last price will be displayed.
    • Type - Here you can select the order type. The available types depend on the used data provider.
    • Quantity - Define the quantity you want to buy or sell.
    • Duration - Enter the period of validity here.
    • Stop - Enter the stop value here. This option is active only if the defined type requires a stop price.
    • Limit - Enter the limit value here. This option is active only if the defined type requires a limit price.
    • Account - Here you can select the account. The available accounts depend on the accounts configured in the Tradesignal options.
    • Buy - Send a buy order to your broker. In addition, the current ask value will be displayed.
    • Sell - Send a sell order to your broker. In addition, the current bid value will be displayed.
    The order bar is an independent feature. You do not need an open chart with an instrument, as long as all necessary information has been entered correctly.

    However, as soon as a chart with a new/different instrument is opened and you select its symbol in the chart legend, the currently used symbol in the order bar will be replaced with this symbol. In this case you may need to adjust your settings, e.g. the quantity.

    Button Menu Order Routing


    Button Menu Order Routing
    Open this drop-down menu by clicking on the Order Routing button in the Trading System group in the toolbar.
    • Show Order Bar - In the order bar you can enter quick settings for the order type (buy, sell), the stop types and quantities and enter stop and limit values. The order bar settings are configured as described in the Order Routing Options.
    • 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

    Note: The following options are available only in Tradesignal 5.3 and above.

    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.