AlgoTraderAlgoTrader Documentation

Chapter 3. Starting AlgoTrader

3.1. Simulation Mode
3.2. Live Trading Mode
3.2.1. Embedded Mode
3.2.2. Distributed Mode
3.3. Server Environment
3.3.1. Embedded Mode
3.3.2. Distributed Mode

As a first step one needs to make sure that the appropriate algotrader license key is properly configured. The license key was provided in the Email after signing up for the AlgoTrader free 30-day trial or when purchasing an algotrader license. The license key needs to be configured inside the file /algotrader-conf/src/main/resources/conf.properties as follows.

Now AlgoTrader can be started through various Eclipse Run Configurations which are available to launch the various operation modes of AlgoTrader. To access the available Eclipse Run Configurations follow screen shots below. For more information on Eclipse Run Configurations, please see https://wiki.eclipse.org/FAQ_What_is_a_launch_configuration.

Open Run Configurations

Select the downward facing black arrow next to the green run symbol


Select Run Configuration

Select the Run Configuration in the list on the left. The right hand side will show the project the Run Configuration will start in as well as the Main Java class


Update program and VM arguments if necessary

To run AlgoTrader in Simulation Mode and perform a back test of a strategy the class ch.algotrader.starter.SimulationStarter has to be invoked. This will run the strategy using the embedded in-memory database h2.

In Eclipse Run Configurations named SimulationStarter-simulate-xxx are provided which contain the following items:

To run AlgoTrader in Live Trading Mode the corresponding Broker or Exchange Interface (e.g. local broker client, Fix session, VPN Connection, etc.) needs to be up and running.

If using InteractiveBrokers the Trader Workstation or the IB Gateway have to be running with the following configurations under API/Settings:

When running AlgoTrader in Live Trading Mode the AlgoTrader Server and the Strategies can either be run in separate JVM's (distributed mode) or the entire system can be run within one single JVM (embedded mode).

Before starting AlgoTrader check the database table strategy. The column AUTO_ACTIVATE should be set to true for records corresponding to the AlgoTrader Server and the trading strategy one wants to trade.

AlgoTrader uses Docker for server environment installations. When using Docker this various components of the system as well as their configurations are managed trough docker-compose.yml files. As a first step when using The AlgoTrader Docker server environment is to configure the AlgoTrader license key within the docker-compose.yml file by replacing the ... with the license key that was provided in the Email after signing up for the AlgoTrader free 30-day trial or when purchasing an algotrader license

xyz:
  image: xyz
  command: -d
  environment:
    - VM_ARGUMENTS=-Dkeygen.id=...


algotrader:
  image: docker.algotrader.ch/algotrader/algotrader
  container_name: algotrader
  environment:
    - VM_ARGUMENTS=-Dkeygen.id=...