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.