After you set up and successfully build your AlgoTrader project:
Examples project:
https://www.algotrader.com/downloads/latest-examples
Bootstrap project:
https://www.algotrader.com/downloads/latest-bootstrap
It's time to run and test it. The first thing that you need to do to prepare your Algotrader to the first start is to fill your database with sample data. To do so first you need to execute flyway script that will create a proper schema in your database:
1. Open your terminal window, in your bootstrap project go to:
\bootstrap\conf\flyway
and execute:
flyway clean migrate
after successful execution:
We can load our sample data to the database, mysql-data.sql file containing sample data can be found in bootstrap project files:
bootstrap\conf\src\main\resources\db-samples\mysql
2. When our database is set up and running it's time to run the Reference data starter.
In your eclipse environment click Run -> Run configurations
Create a new Java Application launcher and set Project as:
algotrader-launch
and Main Class as:
ch.algotrader.starter.ReferenceDataStarter
After that go to the Arguments tab
Here it's needed to provide program arguments, what's already described in the Reference Data section in our documentation: Reference Data and VM arguments, Spring profiles:
-Dspring.profiles.active=<dataSource>,<marketDataProfile>
and proper exchange keys. Click Run.
After successful execution your console log should look like this:
3. Now everything is set up and ready to run AlgoTrader Server Starter to do this again in your eclipse environment click Run -> Run configurations and create a new Java Application launcher with Project set as:
algotrader-launch
and Main Class as:
ch.algotrader.starter.ServerStarter
After that go to the Arguments tab and provide VM Arguments:
-Dspring.profiles.active=live,<dataSource>,<marketDataProfile>,<brokerProfile>,embeddedBroker,html5
and proper exchange keys.
For further information regarding launching AlgoTrader check our documentation: http://doc.algotrader.com/html_single/index.html#Distributed_Mode
In our Bitfinex example ServerStarter Arguments tab will look like this:
Click Run.
After few seconds your browser window will popup with AlgoTrater UI:
Here you can subscribe securities that you are interested in and put orders manually. It is possible to run ServerStarter as Exchange simulator too. To use the Exchange Simulator the Spring profile simulation
has to be used, e.g.
-Dspring.profiles.active=simulation...
Note that when using the Exchange Simulator in live trading, order will be executed against live data internally and will not get sent to the external Broker or Exchange. If the Spring Profile simulation
is enabled all other external Order Services will be disabled.
-Dsimulation=true
denotes a back test and will effectively disable external MarketData services, so if the intention is to run exchange simulator against live market data, make sure that this parameter is set to false
All external order services must be disabled, e.g. Spring profiles like bFX, bFL etc must be inactive, for further details please see Exchange Simulator section of our documentation.
Additional spring profiles for different exchanges available in AlgoTrader: Spring Profiles
Comments
0 comments
Please sign in to leave a comment.