AlgoTraderAlgoTrader Documentation

Chapter 14. Performance Measurement

14.1. Portfolio Value Logging
14.2. Portfolio Value Restoration Feature

AlgoTrader provides a sophisticated Performance Measurement functionality that consists of the following components:

All Performance Measurement features depend mainly on the Entity Portfolio Value which has the following attributes

In Live-Trading Mode Portfolio Values are recorded to the database for all running strategies on an hourly basis. In addition Portfolio Values are recorded every time a transaction occurs that influences performance. For the AlgoTrader Server these are Credits and Debits and for strategies, these are Rebalances. The corresponding value of the transaction is recorded in the optional attribute cashFlow of the Portfolio Value.

In Simulation Mode Portfolio Values are recorded to the file PortfolioReport.csv through the PortfolioReport class on a daily-basis using the AlgoTrader Reporting Functionality, see: Chapter 34, Reporting.

In case a transaction that influences performance needs to be recorded for a prior period in time, all Portfolio Values since that time period are invalid and need to be restored. Usage of this feature is quite common in Reconciliation where a Cash Transaction has to be recorded for the last trading day as soon as the external reconciliation file arrives.

Through the class RestorePortfolioValueStarter which uses PortfolioPersistenceService.restorePortfolioValues() Portfolio Values can be restored for the specified strategy and time period. For the restoration of each Portfolio Value all corresponding transactions up to that time have to be evaluated.