AlgoTraderAlgoTrader Documentation

AlgoTrader

Algorithmic Trading Software


Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
1. Introduction
2. Installation and Deployment
2.1. Development Environment Installation
2.1.1. Prerequisites
2.1.2. AlgoTrader Eclipse Client Installation
2.1.3. Next Steps
2.2. Server Environment Installation
2.2.1. Docker based Installation
2.2.2. Docker Containers
2.2.3. Docker Compose
2.2.4. Docker Management
2.3. VM-Arguments
3. Building AlgoTrader
3.1. Command Line
3.1.1. Git Checkout
3.1.2. Maven Build
3.1.3. Docker Build
3.2. Eclipse
3.2.1. Git Checkout
3.2.2. Maven Build
3.2.3. Docker Build
4. Starting AlgoTrader
4.1. Simulation Mode
4.2. Live Trading Mode
4.2.1. Embedded Mode
4.2.2. Distributed Mode
4.3. Server Environment
4.3.1. Embedded Mode
4.3.2. Distributed Mode
5. Strategy Development
5.1. Creating a Trading Strategy
5.1.1. AlgoTrader Strategy Wizard
5.1.2. AlgoTrader Maven Archetype
5.1.3. Generated Artifacts
5.1.4. MovService.java
5.1.5. module-mov.epl
5.1.6. conf-mov.properties
5.1.7. esper-mov.cfg.xml
5.1.8. applicationContext-client-mov.xml
5.1.9. h2-mov.sql
5.1.10. mysql-mov.sql
5.1.11. Dockerfile
5.2. Building a Trading Strategy
5.3. Hints for Strategy Development
5.3.1. Strategy starters
5.3.2. Print Statement Selects
5.3.3. Logging values of an Indicator to a log file
5.3.4. Access to Esper Variables
5.3.5. Esper Utility classes
5.3.6. Storing the latest Market Data Events
5.3.7. MarketDataCacheService
5.3.8. Prioritizing Statements
5.3.9. Market Data Event Prefeeding
5.3.10. Creation of Bars based on Ticks
5.3.11. Reacting upon a newly subscribed security
5.3.12. Reacting upon an order
5.3.13. Waiting on market data session upon strategy startup
5.3.14. Tagging of orders
5.3.15. Exposing a strategy specific method through the client
5.3.16. Prevent LazyInitializationException
5.3.17. Prevent an action from happening multiple times
5.3.18. Execute an action once a day at a certain time
5.3.19. Rolling of Futures and Options
5.3.20. Handle Constant Maturity Futures
5.3.21. State based Strategy
5.3.22. Prevent Memory leaks
5.3.23. Comparing CSV files
5.4. Strategy Groups
6. Strategy Backtesting
6.1. Exchange Simulator
6.1.1. In-Process Exchange Simulator
6.2. Simulation Process
6.3. Single Run Simulation
6.4. Automated Parameter Optimization
6.5. Performance Statistics
6.6. Multi Security Simulations
7. Architecture
8. Domain Model
8.1. Entities
8.1.1. Strategy
8.1.2. Security
8.1.3. Market Data Events
8.1.4. Order
8.1.5. Account
8.1.6. Transaction
8.1.7. Position
8.1.8. Subscription
8.1.9. Exchange
8.1.10. Property
8.1.11. Order Preference
8.2. Data access objects (DAOs)
8.3. Services
8.3.1. Main Services
8.3.2. Private Services
8.3.3. Client Services
8.3.4. Order Services
8.3.5. Market Data Services
8.3.6. Historical Data Services
8.3.7. Reference Data Services
8.3.8. Calendar Service
8.3.9. Reconciliation Services
8.3.10. Reset Service
8.4. Value Object
8.5. Enumerations
9. Java Environment
9.1. Eclipse Projects
9.1.1. common project
9.1.2. core project
9.1.3. strategy projects
9.2. Java Packages
9.3. Maven Environment
9.3.1. algotrader-common
9.3.2. algotrader core
9.3.3. algotrader client
9.3.4. Maven assemblies
10. Code Generation
11. Esper Engine
11.1. Esper Introduction
11.1.1. Introduction to event streams and complex events using Esper
11.1.2. Event representations
11.1.3. Event Stream Analysis
11.1.4. Combining Pattern Matching with Event Stream Analysis
11.1.5. Named windows
11.1.6. Variables
11.2. Esper Quick Start Guide
11.2.1. Event Types
11.2.2. Creating a Statement
11.2.3. Adding a Subscriber
11.2.4. Adding a Listener
11.2.5. Sending events
11.2.6. Configuration
11.3. Esper Documentation
11.4. AlgoTrader specific Esper Artifacts
11.4.1. Engine & EngineManager
11.4.2. Modules
11.4.3. Tags
11.4.4. Subscribers
11.4.5. Listeners
11.4.6. Service method invocation in Esper scripts
11.4.7. Aggregation Functions
11.4.8. Callbacks
12. Database
12.1. Entity Relationship Model
12.2. Data Source
12.3. Transaction Handling
13. Client
13.1. HTML5
13.1.1. Header
13.1.2. Order Table
13.1.3. Transaction Table
13.1.4. Positions Table
13.1.5. Market Data Table
13.1.6. Column Selection and Grouping
13.1.7. Chart Widget
13.1.8. Technologies
13.2. JMX Client
13.2.1. Starting the AlgoTraderClient
13.2.2. AlgoTrader Managed Beans
13.2.3. Charts
13.2.4. JMX Access
13.2.5. Monitoring Functionality
13.2.6. Additional MBeans
13.2.7. JConsole Modification
13.3. Eclipse Client
13.3.1. AlgoTrader Perspective
13.3.2. Strategy Wizard
13.3.3. AlgoTrader Configuration Editor
13.3.4. Esper Colorer
13.4. EsperHQ Client (optional)
13.4.1. Installation
13.4.2. Dialogs
13.5. Reference Data Manager
14. Performance Measurement
14.1. PortfolioValue Logging
14.2. PortfolioValue Restoration Feature
15. Risk Management
16. Forex Handling
16.1. Currency Handling
16.1.1. Futures
16.1.2. Forex
16.1.3. Currency Attribution
16.2. Forex-Hedging
16.2.1. Virtual FX Positions (IB only)
16.2.2. FX Future
17. Options & Futures
17.1. Expiration
17.2. Leverage & Exposure
17.3. Symbol, ISIN & RIC
17.4. Delta Hedging
17.5. Option & Future Chain Download
17.6. Option Greeks
17.7. Option Pricing Engine
17.7.1. SABR Calibration
17.7.2. Option Pricing
17.7.3. References
17.8. OTC Options
18. Reconciliation
18.1. Partner Systems
18.2. Email Handling
18.3. FTP Handling
19. Broker/Exchange Interfaces
20. OrderManagement
20.1. Place Order
20.1.1. Trade Suggestions
20.1.2. Order Properties
20.2. Receive Fills
20.3. Internal Order Id Format
20.4. Symbology
21. Market Data
21.1. Creation of Bars based on Ticks
21.2. Market Data File Format
21.2.1. Tick Data Files
21.2.2. Bar Data Files
21.3. Numeric Precision
21.4. Price normalization
21.5. Market Data Gap Checking
21.6. Generic Events
22. Historical Data
22.1. Google Finance Downloader
23. Adapters
23.1. Fix Interface
23.2. IB Native Interface
23.3. IB Fix Interface
23.4. Bloomberg
23.5. Real Tick
23.6. Trading Technologies (TT) interface
23.7. JP Morgan Fix Interface
23.8. DukasCopy Fix Interface
23.9. Currenex interface
23.10. FXCM interface
23.11. LMAX interface
23.12. Fortex interface
23.13. Session life-cycle events
23.14. Drop-copy support
23.15. FIX configuration
23.15.1. FIX logging
23.15.2. FIX message persistence
24. Execution Algos
24.1. Existing Execution Algos
24.2. Development of Execution Algos
25. Synthetic Securities and Derivative Spreads
25.1. Combination Example
25.2. CombinationService
25.2.1. Create Combination
25.2.2. Update Component Quantity
25.2.3. Remove a Component
26. Spring Services
26.1. BeanRefFactories
26.2. ApplicationContext
26.3. Spring Profiles
26.4. Abstract Services
26.5. Service initilization order
27. Events and Messaging
27.1. Embedded ActiveMQ message broker
27.2. STOPM messaging over WebSockets transprot
27.3. Embedded Jetty HTTP server
27.4. RESTful interface
27.5. JSON data binding
27.6. EventDispatcher
27.7. Event listeners
27.8. Standard event listener classes
27.9. Strategy life-cycle events
27.10. JMS Destinations
27.11. JMS Configuration
28. Configuration and Preferences API
28.1. Configuration Files
28.2. Esper Variables
28.3. Config Providers
28.4. Config Beans
28.5. Config Locator
29. Processes and Networking
29.1. Processes
29.2. Sockets
29.3. RMI
29.4. JMX
29.5. REST over HTTP/S
29.6. Transport security
30. Threading and Concurrency
30.1. Esper Threading
30.2. Transaction Isolation Level
30.3. Hibernate Locking
30.3.1. Optimistic Locking
30.3.2. Pessimistic Locking
31. Hibernate Sessions and Caching
31.1. Hibernate Caching
31.1.1. Level-Zero Cache
32. Metrics
32.1. Configuration
32.2. Metrics Reporting
33. Logging
33.1. log4j2.xml
33.2. Production log4j2.xml
34. Reporting
A. Example Strategy "BreakOut"
A.1. Trading Idea
A.2. Example
A.3. Implementation
A.4. Installation & Startup
B. Example Strategy "Box"
B.1. Trading Idea
B.2. Implementation
B.3. Installation & Startup
C. Example Strategy "Pairs Trading"
C.1. Trading Idea
C.1.1. What Is Pairs Trading?
C.1.2. Pair Trading Lab
C.1.3. AlgoTrader - Pair Trading Lab Integration
C.2. Implementation
C.3. Installation & Startup
C.4. Monitoring the Strategy
D. Example Strategy "IPO"
D.1. Trading Idea
D.2. Implementation
D.3. Installation & Startup