Trading With R
Trading With R
Trading With R
Disclaimer
This is not a demonstration of how to trade!
Content
1. 2. 3. 4. Systematic Trading Process Why R for trading (research) R Tools Simple Trading System
Not as fast as C (or other low level languages) Single-threaded Limited live deployment options
R Tools
quantmod blotter
2. Data Evaluation
quantstrat, TTR quantstrat quantstrat
3. Defining Signals
4. Defining Rules
5. Backtest
quantstrat, blotter
6. Performance Analysis
PerformanceAnalytics
Resources
Package manuals http://stackoverflow.com/questions/tagged/qua ntstrat IRC
Server : chat.freenode.net Channel : #R-Finance
Contact
chinmay.patil@gmail.com chinmay@indigoatlantic.com
Additional Slides
Data preparation
Packages
Data Evaluation
Calculate Indicators
Technical Indicators Fundamental Indicators Macro Indicators
Transform Prices
For complex securities like spreads, options etc
Packages
TTR Signal extraction Any timeseries analysis packages
Defining Signals
Identify signals / patterns from various conditions met by price, indicators etc. Signals just indicate that a particular predefined condition is satisfied Packages
quantstrat
Defining Rules
Define how your strategy should handle different signals Rules decide how to act on the signals Decide trade sizes, trade risk etc. Packages
quantstrat PortfolioAnalytics LPSM
Backtest
Run your Rules over historical data to generate historical simulated trades Log generated trade Packages
blotter quantstrat
Performance Analysis
Calculate per trade performance Calculate portfolio equity performance Analyze returns distributions Check if performance metrics are within required risk/reward constraints Packages
blotter PerformanceAnalytics