User Guide


ATSXL is a Microsoft Excel Add-in that performs the following tasks with unlimited flexibility:

  • Speed up order entries;
  • Manage trades and positions;
  • Automate trading strategies.

Some documents call it ATSXL Add-in as well.

(ATS stands for Automated Trading System, or Automated Trading Strategy. XL is known as a short for Excel.)

Features Summary

You will be able to do the following tasks easily with ATSXL, which can be very time consuming, coding intensive, or even not feasible in traditional ways:

  • Trade with the broker of your choice, such as Interactive Brokers (IB/TWS API), OANDA (REST API), Dukascopy (JForex API), MB Trading (Navigator API), MetaTrader (MT4 Bridge), or other broker through its trading interface with minimum development effort involved.

    You are not limited to certain broker. With ATSXL, your strategy has the least dependency on any of broker's platform and trading interface.

    Note: only interface for Interactive Brokers (IB/TWS API) is currently released, other interfaces will be released soon.

  • Manage lots of order entries simply with a click on the button. ATSXL's Rapid Order Entry interface helps you place, modify or cancel many orders instantly.

    This greatly helps people who make trades manually to take advantages of computer' speed and accuracy.

  • Utilize any software or methodology to analyze and backtest your trading idea and strategy, such as AmiBroker, eSignal, MultiCharts, NinjaTrader, OpenQuant, QuantDeveloper, TradeStation, or even in house application developed with any programming language.

    Note: you don't use ATSXL directly for R&D, however ATSXL makes you focus on the trading idea and strategy using any software or methodology.

  • Enhance your trading strategy with Excel's powerful and highly efficient calculation engine, using formula, dependency, pivot table, other third party Excel Add-ins, and powerful VBA programming!

    Your strategy could be as simple as Moving Average crossover, or as complex as rule based, statistical model based, event driven, or any other type that is up to your creativity and domain expertise.

  • Quantify any aspect of your trading with Excel, MATLAB, R, or other quantitative environments and libraries.

    Signal filtering, position sizing, risk control, strategy execution flow control, and even decision making are examples that quantitative method can be effectively applied.

  • Run your trading strategy with ATSXL in automatic mode, in semi-automatic mode, or at your discretion (i.e. manual trading with fast order entry).

    There is ultimate flexibility in the way you run the trading system that depends on your trading style or strategy.

  • Automate your trading strategy with ATSXL, keep it running at home, or deploy it to remote server (dedicated server or VPS) or cloud computing facility (i.e. Amazon EC2).

    Running an automated or semi-automated trading system in remote datacenter will take advantages of the facility's redundant power supply, server-class hardware, and superb network connectivity. And you can access the server and control your trading system from anywhere.

  • Monitor the trades and trading strategy execution with ATSXL and a third party commercial log monitoring software that ensures you receive updates on trading activities and critical events of your interest, through sound, SMS, or Email.

    Of course, you can use your own program or script as long as it can monitor ATSXL's log files to meet your needs.

Installation and Configuration

Please refer to the QuickStart Guide for the detailed steps on ATSXL installation and configuration, including its supporting Excel spreadsheet.

Configure Microsoft Excel

Note that you need to configure Microsoft Excel properly for ATSXL. Please follow detailed steps here.

How Does It Make Automated Trading

Put it in a simple way, ATSXL automates a trading strategy by repeatedly doing three steps below:

  • Retrieve messages (or signals) from an external file, and update them on the MSG Worksheet;

    You can use almost any technical analysis software (or quantitative environment) to generate these messages (or signals).

  • There are four worksheets (CFG, MSG, CORE, Orders) in the Excel spreadsheet that keep ever changing data, states and other information;

    The trading strategy or trading plans are kept on the CORE Worksheet.

  • Orders kept on the Orders Worksheet will be sent out according to the trading plan;

    Interface for different broker can be integrated on this layer.

You will spend more time on these four Excel worksheets when you start using ATSXL. Their names are located at the bottom of Excel's working area, shown as CFG, MSG, CORE and Basic Orders (for IB TWS).

Each of them is briefly outlined below and followed by a simplified example to show the work flow and how these worksheets interact.


CFG Worksheet for Configurations

CFG Worksheet includes most configurations, which are read by ATSXL when it is loaded into Excel. And, many of the configurations can be re-loaded with different values later on.


MSG Worksheet for Messages (or Signals)

MSG Worksheet keeps messages (or signals) read from an external file, which is updated by external software, i.e. AmiBroker's Exploration can be used to generate a signal file. Apparently, you can use any other software for this purpose.

For the details about MSG Worksheets and the specifications about this external file, please refer to ATSXL MSG Worksheet in the User Guide.


Orders Worksheet for Order Entries

Orders Worksheet keeps all the order entries that can be sent to Broker's trade server, and keeps order updates retrieved from there. The worksheet name is Basic Orders within twsATSXL.xls spreadsheet.

Each row on the Orders Worksheet that has an order entry defined is called Order Row. (Free Edition can control no more than 50 Order Rows, for details please refer to Editions and Licensing.)

There is actually another worksheet that works with the Orders Worksheet to further provides more control and flexibility for order entries. It is called TwsOrdCtrl within twsATSXL spreadsheet.

With this Order Control Worksheet, it is possible to use different position size for each order entry, or even make the position size dynamic based on certain conditions or algorithm.


CORE Worksheet for Trading Strategy

CORE Worksheet is the most important one among these worksheets because your actual trading strategy will be deployed here. The following depicts how a trading strategy is represented on the CORE Worksheet:

  • One Trading Strategy is defined as one (or more) group(s) of trading plans. i.e. for one ticker, there is a group of trading plans to create and manage long positions, while another group will create and manage short positions;
  • Each Trading Plan is further represented as a group of Excel Rows on the CORE Worksheet,
    where each Excel Row is a combination of conditions and actions;
  • Each Trading Plan can be enabled or disabled based on conditions defined on its associated Excel Rows.
    Condition can be anything on the worksheet, such as a static flag, a value from another worksheet, or a complex formula, and so on;
  • Each enabled Trading Plan determines what action shall be performed, where action can be different based on conditions.
    Action can be something like placing/updating an order, cancelling an order, creating an order alert, or even suspending another trading plan, and so on;

With all the capabilities and flexibilities available on the CORE Worksheet, it is possible for you to create either simple trading strategy or sophisticated ones.


An Example Putting Things Together

Here is a typical, simplified work flow as an example:

ATSXL reads signals from an external file, and then writes these signals on the MSG Worksheet.

Then ATSXL starts reading each trading plan (as a group of Excel Rows) that is deployed on the CORE Worksheet. For each trading plan (and its rows with conditions and actions defined there), if the trading plan is determined to be a match for certain signal, ATSXL will update it with the latest message (or signal) read from the MSG Worksheet. ATSXL then checks if the trading plan remains enabled and then performs one (or more) action associated with the trading plan, i.e. place an order, update order, cancel order, create an alert, clear a certain range of fields, and so on.

For each ticker, ATSXL continues to process its trading plans until it reaches the end of the group(s) of trading plans.

ATSXL also retrieves updates from Broker's trade server and applies these updates on the Orders Worksheet. You will be able to use these updates on the Orders Worksheet to adjust the trading plans on the CORE Worksheet, i.e. for a filled order, its associated trading plan to cancel the order should be disabled, but the trading plan to create or adjust existing stoploss order will be enabled, and etc.

ATSXL has a built in timer to repeat the above tasks on certain frequency specified by user.

Excel Worksheets for ATSXL

The following Excel Worksheets work together with ATSXL Add-in. Please refer to the following documents that are dedicated to each worksheet.

CFG Worksheet

MSG Worksheet

INFO Worksheet

CORE Worksheet

IB TWS Basic Orders Worksheet

IB TWS TwsOrdCtrl Worksheet

LOG Worksheet

Appendix A: System Requirements

ATSXL was designed and built to run with the minimum resources, which makes it perfect for a remote datacenter or cloud that hosts dedicated or virtualized server. For example, ATSXL runs on Windows Server 2003 with only 512MB RAM and single CPU. Of course, ATSXL runs on a home PC without any problem.

Hardware and Operating System (OS)

ATSXL runs on a broad range of Microsoft Windows platforms and underlying hardware:

  • Any x86 compatible hardware or virtualized server that runs Microsoft Windows environment will be sufficient;
  • Minimum 512MB RAM, i.e. when it's deployed in a remote server with less resources allocated;
  • Mainstream Microsoft Windows editions, from Windows XP (with SP3) to Windows 7, from Windows Server 2003 to Windows Server 2012;


You need to install the following software packages before you can run ATSXL:

  • Microsoft .NET Framework 2.0 or later;
    .Net 3.0 or 3.5 should be OK as they will also install .Net 2.0.

    Note that .Net Framework 4.0 or later can not be used.
  • Any software that generates signals for ATSXL, i.e. AmiBroker, MetaTrader 4 (MT4) or any analysis toolkit of your choice;
  • The Broker's platform that supports trading API, i.e. Interactive Broker's TWS;
  • (Optional) The software that monitors ATSXL's log files, i.e. Log Stash. It is highly recommended if ATSXL is used to automate a trading strategy.

Appendix B: Editions and License Agreement

ATSXL Free Edition

This edition can be used for free as long as it is not for Commercial and/or Non-personal Use.

When Free Edition runs in automatic mode, it supports one Ticker and no more than 50 Order Rows, while there is no such limit when it runs in manual mode.

Note that the limit of Order Rows refers to the rows on one specific Excel spreadsheet that contains order entries controlled by the trading strategy. It is not the number of orders you can place, modify or cancel. You can make as many trades as you need with the Free Edition.

The following cases are not supported by ATSXL Free Edition according its license and the above limitations, you should use ATSXL Pro Edition instead:

  • You use ATSXL to conduct trading for a business entity or for other people rather than for yourself;
  • You use ATSXL to conduct trading with other people's money involved;
  • You, as an independent trader, trade up that multiple tickers or trading strategy execution speed becomes the need;

For detailed terms and conditions, refer to the License Agreement for ATSXL Free Edition.

ATSXL Pro Edition

Pro Edition supports multiple Tickers and more Trade Rows used by the trading strategy. More importantly, Pro Edition runs much faster than Free Edition even with multiple tickers, more trades and positions, and more complex trading strategy involved.

Pro Edition is currently deployed for private use. It is not released to public, and the release date is not determined yet.

Appendix C: QuickStart Guide

Here are some QuickStart Guides that help you walk through the step-by-step setup and start using ATSXL.

Please spend one minute or two on the following to find the difference between ATSXL and twsATSXL, otherwise you may feel confused with them later on.

ATSXL vs. twsATSXL and the Like

You very often read terms ATSXL and twsATSXL (or onaATSXL, dukATSXL, etc), which represent different things although they look similar.

ATSXL is a Microsoft Excel Add-in, also known as ATSXL Add-in.

twsATSXL is a Microsoft Excel spreadsheet.

twsATSXL package is a zipped file.

AmiBroker to Trade with IB TWS (Level 101)

This QuickStart Guide shows you how to use twsATSXL, AmiBroker and IB Trading API to automate a trading strategy that combines Guppy Multiple Moving Average (GMMA) and Bollinger Band (BB).

For level 101, this guide shows you how to automate a "simple" strategy that uses Entry, Exit and Stop Trailing signals. Anyone who has experience in automating a similar trading system knows it normally involves a lot of coding! Note that although these signals are generated from GMMA and BB using AmiBroker, they can be created by any other indicators, or algorithms or even other software rather than AmiBroker.

Manual trading that needs fast order entry? If you do manual/discretionary trading most time, this QuickStart Guide also helps you walk through essential configurations until step Make Trade Manually with twsATSXL, upon there you are fully up to trade with twsATSXL that supports fast order entry.

(More details...)

AmiBroker to Trade with IB TWS (Level 201)

Once you complete level 101, this guide continues to show you some advanced features from ATSXL, such as managing multiple orders (with different rate) and positions at same time, moving multiple trailing stops based on certain condition. We use the same signals generated from GMMA and BB using AmiBroker, however we stated already, these signals can be created by any other indicators, algorithms or even other software rather than AmiBroker.

The best thing here is that you do not write any code while developing more complex trading strategy because twsATSXL now helps you automate the strategy, and manage the orders and positions accordingly. That is one of the most important benefits using ATSXL.

(More details to be added…)