AlgoTraderAlgoTrader Documentation

Chapter 26. Configuration and Preferences API

26.1. Configuration Files
26.1.1. Encrypting sensitive configuration values
26.2. Esper Variables

The AlgoTrader Server contains the following two main configuration files.

conf.properties the main public configuration file:

conf-core.properties contains settings that are only used by the core project:

In addition adapters may have their own settings file. e.g.conf-ib.properties for IB and conf-bb.properties for BB.

Configuration parameters can be changed inside the .properties files. As an alternative configuration parameters can be provided as VM arguments in which case they will overwrite existing parameters inside *.properties files.

-Dstatement.closePosition=false

Most configuration parameters are prefixed with a namespace (e.g. dataSource, simulation, statement, misc, etc.)

For security reasons, it is recommended to store sensitive configuration like adapter API key and API secret, in encrypted form.

In Docker based installations the recommended method for that is using Docker Secrets

For non-Docker installations it is possible to encrypt property value using Jasypt command line utility:

...\jasypt-1.9.2\bin>encrypt password="mypassword" input="revdPMxxxxxxxxwCPo"

The encrypted value should be copied to relevant property file, e.g. to conf-bmx.properties. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"API Key"}
bmx.apiKey=ENC(Gv5bH18YmbavDnC3DExCMKTOh7wRq5VuKpeNo5tYmaALkpJw0ApEMA==) 

The steps above should be done for each sensitive value (e.g. apiKey, apiSecret) of each adapter.

In addition the following VM argument must be set to enable encryption

-Dconfig.encryption=true

Each time the system starts, the user will be prompted to enter the password.

The configuration files are also used to define values for Esper variables. Because the Esper Variable system is strong typed, variables with their type have to be configured within the corresponding Esper configuration files. e.g.


<variable name="simulation_eventsPerDay" type="long"/>