1 / 17

R/ quantstrat For Fun & Profit

Motivation Why R/ quantstrat ? Overview: The Toolset Data Warehousing with XTS Modeling Backtesting. R/ quantstrat For Fun & Profit. E. Allen ( e@biglucre.com ) Nov. 4 th 2013 Pittsburgh R Users Group Lightning Talk. Jan Humme , Brian Peterson @ R/Finance 2013:

montana
Download Presentation

R/ quantstrat For Fun & Profit

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Motivation • Why R/quantstrat? • Overview: The Toolset • Data Warehousing with XTS • Modeling • Backtesting R/quantstratFor Fun & Profit E. Allen (e@biglucre.com) Nov. 4th 2013 Pittsburgh R Users Group Lightning Talk

  2. Jan Humme, Brian Peterson @ R/Finance 2013: • http://www.rinfinance.com/agenda/2013/workshop/Humme+Peterson.pdf • Guy Yollin, quantstrat/blotter lecture notes: • http://www.r-programming.org/papers • Blair Hull @ R/Finance 2012: • http://www.rinfinance.com/agenda/2012/talk/BlairHull.pdf • My Blog: http://ww.biglucre.com/ • This presentation focuses on brevity and perceived gaps in more comprehensive resources. Slides will be available. References

  3. R/quantstratFor 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/quantstratFor 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/quantstratFor Fun & Profit: The Toolset The Toolset (from Humme/Peterson)

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

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

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

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

  10. R/quantstratFor Fun & Profit: The Toolset: quantstrat Toolset: quantstrat Functional Programming Workflow Indicators and Signals add columns to mkdataxts 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/quantstratFor Fun & Profit: Data Warehousing Data Warehousing Acquire Data Record from feed (IQFeed, Interactive Brokers) Purchase (tickdata.com, IQFeed6-mo backfill) Code for the following forthcoming at www.biglucre.com Import Data Use read.csv, convert to xts, name columns for BBO or OHLC data Use FinancialInstrumentSaveSymbols()/getSymbols.FI to save xtsdata into daily .rda data files load/merge subsets of daily data into xts objects

  12. R/quantstratFor Fun & Profit: Modeling Modeling R offers many useful packages. Some examples: urca: Unit root and cointegration tests for time series data http://cran.r-project.org/web/packages/urca/index.html fGarch: Rmetrics - Autoregressive Conditional HeteroskedasticModelling http://cran.r-project.org/web/packages/urca/index.html

  13. R/quantstratFor Fun & Profit: Backtesting Backtesting(from Humme/Peterson)

  14. R/quantstratFor Fun & Profit: Backtesting Backtesting(from Humme/Peterson)

  15. R/quantstratFor Fun & Profit: Optimization Optimization/Parallelization (from Guy Yollin)

  16. R/quantstratFor Fun & Profit: Questions? Questions?

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

More Related