AlgoTraderAlgoTrader Documentation

Chapter 25. Spring Services

25.1. Starter Classes
25.2. Spring Profiles

AlgoTrader provides the following starter classes to start up the system for the various operational modes

  • Reference Data Starters

    When downloading reference data (see Chapter 20, Reference Data) you need to have the following profiles active: singleDataSource or pooledDataSource and the profile of the adapter you want to get reference data from (see table below).

    You can only have one adapter reference data profile enabled at a time.

  • Historical Data Starters

    When downloading historical data (see Section 19.3, “Historical Data Download”) you need to have the following profiles active: singleDataSource or pooledDataSource, influxDB and the profile of the adapter you want to get historical data from (see table below).

    You can only have one adapter historical data profile enabled at a time.

  • Simulation Starter

    To run a back-test (see Chapter 5, Strategy Backtesting), you need to have the following profiles active: any dataSource profile (although embeddedDataSource is recommended), simulation if you're back testing with CSV files. If you are using InfluxDB for back testing, you also need to add influxDB.

  • Embedded Strategy Starters

    When running strategy in embedded mode (see Section 3.2.1, “Embedded Mode”), you need to have the following profiles activate: singleDataSource or pooledDataSource, live, embeddedBroker and html5 (if you want to see/use the UI) and the market data, trading profiles.

    If account data (see Chapter 21, Account Data) is required you also need the account profile (see table below).

    The system can be run with several market data, trading and account profiles in the same process.

    If historical data (see Chapter 19, Historical Data) is required you also need one historicalData profile (see table below) and influxDB. If you do not have a historical data provider but still want to store and retrieve historical data using InfluxDB, you need to set noopHistoricalData in addition to influxDB.

  • Server Starters

    When running the AlgoTrader server in distributed mode (see Section 3.2.2, “Distributed Mode”), you need to have the following profiles activate: singleDataSource or pooledDataSource, live, embeddedBroker and html5 (if you want to see/use the UI) and the market data, trading profiles.

    If account data (see Chapter 21, Account Data) is required you also need the account profile (see table below).

    The system can be run with several market data, trading and account profiles in the same process.

    If historical data (see Chapter 19, Historical Data) is required you also need one historicalData profile (see table below) and influxDB. If you do not have a historical data provider but still want to store and retrieve historical data using InfluxDB, you need to set noopHistoricalData in addition to influxDB.

  • Strategy Starters

    For strategies running in distributed mode (see Section 3.2.2, “Distributed Mode”), it is enough to activate live.

AlgoTrader is heavily relying on Spring Profiles to activate/deactivate various parts of the system based on user requirements.

General Profiles

Data Sources: only one data source can be configured

  • pooledDataSource: c3p0 Pooled Data Source (typically used in live trading both in embedded and distributed mode)

  • singleDataSource: Spring Driver Manager Data Source (typically used by the Reference Data Starter and Historical Data Starter)

  • embeddedDataSource: H2 embedded in-memory Data Source (typically used when performing back tests)

Adapters


All other services not mentioned above are active in all profiles.

To enable a Profile on start-up, the following VM argument has to be used:

-Dspring.profiles.active=iBMarketData,iBNative