Presentation is loading. Please wait.

Presentation is loading. Please wait.

R/quantstrat For Fun & Profit E. Allen Nov. 4 th 2013 Pittsburgh R Users Group Lightning Talk Motivation Why R/quantstrat?

Similar presentations


Presentation on theme: "R/quantstrat For Fun & Profit E. Allen Nov. 4 th 2013 Pittsburgh R Users Group Lightning Talk Motivation Why R/quantstrat?"— Presentation transcript:

1 R/quantstrat For Fun & Profit E. Allen Nov. 4 th 2013 Pittsburgh R Users Group Lightning Talk Motivation Why R/quantstrat? Overview: The Toolset Data Warehousing with XTS Modeling Backtesting

2 References Jan Humme, Brian R/Finance 2013: Guy Yollin, quantstrat/blotter lecture notes: Blair R/Finance 2012: My Blog: This presentation focuses on brevity and perceived gaps in more comprehensive resources. Slides will be available.

3 R/quantstrat For Fun & Profit: Motivation Quantitative Trading Motivation Profit! But, it’s risky – not good for regular income to pay the rent. Don’t quit your day job – unless you’re working for a group that really knows what they’re doing. But, it is also interesting! Not as expensive as you might think to trade –except for High Frequency.

4 R/quantstrat For Fun & Profit: Why R/quantstrat? Why R/quantstrat? Features – Leveraging framework with much of what commercial packages offer. Flexibility – Ability to change for own use. Cost Used in professional trading firms. From Blair Hull: xts, xtime, indexing, sde, monomvn, lars, fUnitRoots, fGarch, manova Proprietary trading firm contributions, even those with large operations.

5 R/quantstrat For Fun & Profit: The Toolset The Toolset (from Humme/Peterson)

6 R/quantstrat For Fun & Profit: The Toolset: quantstrat The Toolset: quantstrat Part of the TradeAnalytics package https://r-forge.r-project.org/projects/blotter/ https://r-forge.r-project.org/projects/blotter/ Not yet available on CRAN (under heavy development) Installing quantstrat: (Linux/from source)http://biglucre.com/environment/ or, you can try: install.packages("quantstrat", repos="http://R-Forge.R- project.org")

7 R/quantstrat For Fun & Profit: The Toolset: quantstrat The Toolset: quantstrat Recommended Reading: Trading Systems: A New Approach to System Development and Portfolio Optimisation by Tomasini and Jaekle This text follows the development and testing of a simple system, Luxor which is featured in several quantstrat demos.

8 R/quantstrat For Fun & Profit: The Toolset: quantstrat Professional+Commercial Tools will provide: 1.Data Warehouse 2.System Development 3.Production Strategy Deployment R/quantstrat can be used for 1 and 2 – maybe 3.

9 R/quantstrat For Fun & Profit: The Toolset: quantstrat Toolset: quantstrat (from Humme/Peterson)

10 R/quantstrat For Fun & Profit: The Toolset: quantstrat Toolset: quantstrat Functional Programming Workflow Indicators and Signals add columns to mkdata xts object. Applying a Strategy results in a blotter object that contains trade information, ready for analysis. More advanced features include optimization methods and parallelization.

11 R/quantstrat For Fun & Profit: Data Warehousing Data Warehousing Acquire Data Record from feed (IQFeed, Interactive Brokers) Purchase (tickdata.com, IQFeed 6-mo backfill) Code for the following forthcoming at Import Data Use read.csv, convert to xts, name columns for BBO or OHLC data Use FinancialInstrument SaveSymbols()/getSymbols.FI to save xts data into daily.rda data files load/merge subsets of daily data into xts objects

12 R/quantstrat For Fun & Profit: Modeling Modeling R offers many useful packages. Some examples: urca: Unit root and cointegration tests for time series data fGarch: Rmetrics - Autoregressive Conditional Heteroskedastic Modelling

13 R/quantstrat For Fun & Profit: Backtesting Backtesting (from Humme/Peterson)

14 R/quantstrat For Fun & Profit: Backtesting Backtesting (from Humme/Peterson)

15 R/quantstrat For Fun & Profit: Optimization Optimization/Parallelization (from Guy Yollin)

16 R/quantstrat For Fun & Profit: Questions? Questions?

17 Appendix A: Equity curve for a strategy under development.


Download ppt "R/quantstrat For Fun & Profit E. Allen Nov. 4 th 2013 Pittsburgh R Users Group Lightning Talk Motivation Why R/quantstrat?"

Similar presentations


Ads by Google