AlgoTraderAlgoTrader Documentation

Chapter 3. Starting a Trading Strategy

3.1. Starting a Back Test
3.2. Starting Live Trading

This section gives a quick introduction on how to start a trading strategy by discussing the Box example strategy.

To start any of the other strategies please consult the relevant parts in the documentation:

First you to start the AlgoTrader IntelliJ IDE (Integrated Development Environment) using the Idea for AlgoTrader icon on the desktop.

As a first step, please copy the license key that was provided in the Email after signing up for the AlgoTrader free 30-day trial into the file /algotrader-conf/src/main/resources/conf.properties.

The back-test in this example strategy runs with CSV files. If you have a historical data provider that AlgoTrader supports, you could also run vs. InfluxDB and would have to load the historical data first by running a HistoricalDataStarter (see Historical Data).

Launch the SimulationStarter-simulate-box by first clicking the downward facing arrow next to the green start icon (top right), selecting SimulationStarter-simulate-box and pressing the green start icon.

The system will now perform a back test based on historical data

Once the back test has finished, the Excel based back test report will prompt to be opened. For this, it would be beneficial if you installed Excel on the machine first. Alternatively, you can move the files under Desktop\Algotrader Examples\examples\box\files\report\ to machine that has Excel installed and open BackTestReport.xlsm.

For further information regarding back testing, visit the following chapters in the documentation:

The following sections describes how to use AlgoTrader in Live Trading mode by using Interactive Brokers for market data and trading.

If you do not have an Interactive Brokers account, you can create a demo account on the Interactive Brokers Trader Workstation (TWS) using the shortcut on the desktop.

The downside of the TWS demo account is that it uses delayed market data, your orders/trades/positions are reset at the end of each day. It also automatically shuts down on a daily basis.

After starting the TWS, go to Try the demo or Return to the demo and enter your email address


The first time you start TWS, go to File / Global Configuration, then select API / Settings, make sure that Enable ActiveX and Socket Clients is enabled, Read-Only API is disabled and Socket port is set to 4001.

You can now launch the AlgoTrader example box strategy by first clicking the downward facing arrow next to the green start icon, selecting EmbeddedStrategyStarter-box and pressing the green start icon. This will start the AlgoTrader server as well as the Box strategy and will connect to the Interactive Brokers Gateway.

Once the system is started up it will automatically open the AlgoTrader UI (within the Chrome browser).

You can add and resize the strategy widget by pressing on the + on the Dashboard menu on the left.

For further information on live trading, please visit Starting a Strategy in Live Trading Mode

For further information on the AlgoTrader Web UI please visit the AlgoTrader documentation regarding the HTML5 UI