AlgoTraderAlgoTrader Documentation

Reference Guide

AlgoTrader

Version 5.1


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 IDE Installation
2.1.3. AlgoTrader Server Code Installation
2.1.4. Python installation
2.1.5. 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. Starting AlgoTrader
3.1. Simulation Mode
3.2. Live Trading Mode
3.2.1. Embedded Mode
3.2.2. Distributed Mode
3.3. Server Environment
3.3.1. Embedded Mode
3.3.2. Distributed Mode
4. Strategy Development
4.1. Creating a Trading Strategy
4.1.1. AlgoTrader Strategy Wizard
4.1.2. AlgoTrader Maven Archetype
4.1.3. Generated Artifacts Java Archetype
4.1.4. Generated Artifacts Simple Java Archetype
4.1.5. Generated Artifacts Esper Archetype
4.2. Building a Trading Strategy
4.3. Hints for Strategy Development
4.3.1. Java based Strategies
4.3.2. Esper based Strategies
4.4. Strategy life-cycle events
4.5. Strategy Development in Python
4.5.1. Python Strategy Performance
5. Strategy Backtesting
5.1. Exchange Simulator
5.2. Simulation Process
5.3. Single Run Simulation
5.4. Automated Parameter Optimization
5.5. Performance Statistics
5.6. In-Process Exchange Simulator (deprecated)
5.7. Multi Security Simulations
6. Architecture
7. Domain Model
7.1. Entities
7.1.1. Strategy
7.1.2. Security
7.1.3. Market Data Events
7.1.4. Order
7.1.5. Account
7.1.6. Transaction
7.1.7. Position
7.1.8. Cash Balance
7.1.9. Subscription
7.1.10. Exchange
7.1.11. Order Preference
7.2. Services
7.2.1. Main Services
7.2.2. Client Services
7.2.3. Account Service
7.2.4. Calendar Service
7.2.5. Combination Service
7.2.6. Future Service
7.2.7. Historical Data Service
7.2.8. Market Data Service
7.2.9. Measurement Service
7.2.10. Option Service
7.2.11. Order Service
7.2.12. Portfolio Service
7.2.13. Position Service
7.2.14. Property Service
7.2.15. Reference Data Service
7.2.16. Market Data Cache Service
7.2.17. Lookup Service
7.2.18. Strategy Service & Config Aware Strategy Service
7.2.19. Subscription Service
7.2.20. Reset Service
7.3. Value Object
7.4. Enumerations
8. Esper Engine
8.1. Esper Introduction
8.1.1. Introduction to event streams and complex events using Esper
8.1.2. Event representations
8.1.3. Event Stream Analysis
8.1.4. Combining Pattern Matching with Event Stream Analysis
8.1.5. Named windows
8.1.6. Variables
8.2. Esper Quick Start Guide
8.2.1. Event Types
8.2.2. Creating a Statement
8.2.3. Adding a Subscriber
8.2.4. Adding a Listener
8.2.5. Sending events
8.2.6. Configuration
8.3. Esper Documentation
8.4. AlgoTrader specific Esper Artifacts
8.4.1. Engine & EngineManager
8.4.2. Modules
8.4.3. Tags
8.4.4. Subscribers
8.4.5. Listeners
8.4.6. Service method invocation in Esper scripts
8.4.7. Aggregation Functions
8.4.8. Callbacks
8.5. Esper Threading
9. Database
9.1. Instances
9.2. Flyway
9.3. Files
9.4. Data Source
10. Client
10.1. HTML5 UI
10.1.1. Header
10.1.2. Order Table
10.1.3. Advanced Order Form
10.1.4. Algo Order details UI
10.1.5. Transaction Table
10.1.6. Positions Table
10.1.7. Market Data Table
10.1.8. Column Selection and Grouping
10.1.9. CSV Export
10.1.10. Chart Widget
10.1.11. About pop-up
10.1.12. Technologies
10.1.13. HTML5 Custom Widgets
10.2. AlgoTrader Eclipse IDE
10.2.1. AlgoTrader Perspective
10.2.2. Strategy Wizard
10.2.3. AlgoTrader Configuration Editor
10.2.4. Esper Colorer
10.3. Reference Data Manager
10.4. Historical Data Manager
11. Performance Measurement
11.1. Portfolio Value Logging
11.2. Portfolio Value Restoration Feature
12. Risk Management
12.1. Pre-Trade Checks
13. Forex Handling
13.1. Currency Handling
13.1.1. Futures
13.1.2. Forex
13.1.3. Currency Attribution
13.2. Forex-Hedging
13.2.1. Exchange vs. Margin Trading
13.2.2. FX Future
14. Options & Futures
14.1. Expiration
14.2. Leverage & Exposure
14.3. Symbol, ISIN & RIC
14.4. Delta Hedging
14.5. Option & Future Chain Download
14.6. Option Greeks
14.7. Option Pricing Engine
14.7.1. SABR Calibration
14.7.2. Option Pricing
14.7.3. References
14.8. OTC Options
15. Broker/Exchange Interfaces
16. Order Management
16.1. Order Validation
16.2. Place Order
16.2.1. Order Preferences
16.2.2. Trade Suggestions
16.2.3. Order Properties
16.3. Order Status
16.4. Receive Fills
16.5. Handling of Fees and Commissions
16.6. Examples of Orders and Executions
16.6.1. Margin Order with Fee in Quote Currency
16.6.2. Exchange Order with Fee in Base Currency
16.6.3. Exchange Order with Fee in Alternate Currency
16.7. Internal Order Id Format
16.8. Symbology
17. Market Data
17.1. Creation of Bars based on Ticks
17.2. Creation of Bars based on Bars
17.2.1. Esper Bar Aggregation
17.2.2. Java Bar Aggregation
17.3. Numeric Precision
17.4. Price normalization
17.5. Market Data Gap Checking
17.6. Generic Events
17.7. Generic Tick Events
18. Historical Data
18.1. InfluxDB
18.2. Live Data Recording
18.3. Historical Data Download
18.4. Interactive Brokers Historical Data Download
18.5. Quandl Historical Data Download
18.6. Google Finance Historical Data Download
18.7. CoinAPI Historical Data Download
18.8. CoinMarketCap Historical Data Download
18.9. Market Data File Format
18.9.1. Tick Data Files
18.9.2. Bar Data Files
19. Reference Data
20. Account Data
20.1. Account balances
20.2. Withdrawal
20.3. Deposit address
20.4. Account Events
21. AlgoTrader API
21.1. JSON data binding
21.2. REST API
21.3. WebSocket/STOMP API
21.4. Inbound FIX API
21.4.1. Logon message
21.4.2. Logout message
21.4.3. Test Request message
21.4.4. Heartbeat message
21.4.5. Resend Request message
21.4.6. New Order Single message
21.4.7. Order Cancel Request message
21.4.8. Order Cancel Replace Request message
21.4.9. Execution Report message
22. Adapters
22.1. Fix Interface
22.1.1. FIX configuration
22.1.2. FIX logging
22.1.3. FIX message persistence
22.1.4. FIX Drop-copy support
22.2. Crypto Exchange interfaces
22.2.1. Custom currency mapping
22.2.2. Crypto-Order Constraints
22.2.3. Supported Crypto-Order Types
22.3. Session life-cycle events
22.4. Automatic order reconciliation after re-connect
22.5. Bloomberg
22.6. Currenex
22.7. DukasCopy
22.8. Exante (XNT)
22.9. EzeSoft / Real Tick
22.10. Fortex
22.11. FXCM
22.12. IB Native Interface
22.12.1. IB Market Data Subscriptions
22.12.2. Delayed IB Market Data
22.13. IB Fix Interface
22.14. JP Morgan
22.15. LMAX
22.16. Nexus Prime
22.17. PrimeXM
22.18. Quandl
22.19. QuantHouse
22.20. SocGen
22.21. Trading Technologies (TT)
22.22. UBS
22.23. Binance
22.23.1. Binance Order Constraints
22.23.2. Binance Account Management
22.24. Bitfinex
22.24.1. Bitfinex Order Constraints
22.24.2. Bitfinex Account Management
22.25. Bitflyer
22.25.1. Bitflyer Order Constraints
22.25.2. Bitflyer Account Management
22.26. BitMEX
22.26.1. BitMex Order Constraints
22.26.2. BitMex Account Management
22.27. Bitstamp
22.27.1. Bitstamp Order Constraints
22.27.2. Bitstamp Account Management
22.28. CoinAPI
22.29. Coinbase Pro
22.29.1. CoinBase Pro Order Constraints
22.29.2. Coinbase Pro Account Management
22.30. Coinigy
22.30.1. Setup Instructions
22.30.2. Coinigy Order Constraints
22.30.3. Coinigy Account Management
22.31. CoinMarketCap
23. Execution Algos
23.1. Existing Execution Algos
23.2. Execution Algos Retry and Back-off policies
24. Synthetic Securities and Derivative Spreads
24.1. Combination Example
24.2. Combination Service
24.2.1. Create Combination
24.2.2. Update Component Quantity
24.2.3. Remove a Component
25. Spring Services
25.1. Starter Classes
25.2. Spring Profiles
26. Configuration and Preferences API
26.1. Configuration Files
26.1.1. Encrypting sensitive configuration values
26.2. Esper Variables
27. Processes and Networking
27.1. SSL security
27.1.1. Importing Certificate into Chrome Browser
28. Metrics
28.1. Configuration
28.2. Metrics Reporting
29. Logging
29.1. log4j2.xml
29.2. Production log4j2.xml
30. 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. Strategy Monitoring
B.4. 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. Strategy Monitoring
D. Example Strategy "IPO"
D.1. Trading Idea
D.2. Strategy Monitoring
D.3. Implementation
D.4. Installation & Startup
E. Example Strategy "EMA"
E.1. Trading Idea
E.2. Implementation
E.3. Installation & Startup
F. Example Strategy "Random"
F.1. Trading Idea
F.2. Implementation
F.3. Installation & Startup
G. Example strategy "EMA" in Python
G.1. Description
G.1.1. Implementation
H. Example strategy "BreakOut" in Python
H.1. Description
H.1.1. Implementation
I. Example strategy "EMA" in Python via API
I.1. Description