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 19, 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 18.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 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 20, 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 18, 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 20, 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 18, 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 sufficient to activate the live Spring profile. In order for a strategy to use historical data, reference data or account related information the profiles historicalData, referenceData and account have to be enabled in on the strategy.

  • Reset Starter

    The ResetStarter can be used to reset the state of the database to a pre-defined state either before a simulation or if a reset of live trading is required. For parameters and details, see Section 7.2.21, “Reset Service”

  • Restore Portfolio Value Starter

    The RestorePortfolioValueStarter can restore Portfolio Values for a specified strategy and time period (see Section 11.2, “Portfolio Value Restoration Feature”)

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

General Profiles

Additional services profiles (used only by strategy running in distributed mode)

  • historicalData: means the strategy will require historical data service

  • referenceData: means the strategy will require reference data service

  • account: means the strategy will require account service

  • genericEventsService: means the strategy will require explicit subscription to generic events service

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