quantmod is an R package that provides a framework for quantitative financial modeling and trading. It provides a rapid prototyping environment that makes modeling easier by removing the repetitive workflow issues surrounding data management and visualization.
Professionally-supported quantmod now available
Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional-grade assurances from the experts who know it best, while seamlessly integrating with existing tools.
Supporting quantmod through Patreon
If you are interested in supporting this project, please consider becoming a patron.
The current release is available on CRAN, which you can install via:
To install the development version, you need to clone the repository and build from source, or run one of:
# lightweight remotes::install_github("joshuaulrich/quantmod") # or devtools::install_github("joshuaulrich/quantmod")
You may need tools to compile C, C++, or Fortran code. See the relevant appendix in the R Installation and Administration manual for your operating system:
It is possible to import data from a variety of sources with one quantmod
getSymbols(). For example:
> getSymbols("AAPL", src = "yahoo") # from yahoo finance  "AAPL" > getSymbols("DEXJPUS", src = "FRED") # FX rates from FRED  "DEXJPUS"
Once you've imported the data, you can use
chartSeries() to visualize it and
even add technical indicators from the TTR
> getSymbols("AAPL")  "AAPL" > chartSeries(AAPL) > addMACD() > addBBands()
Have a question?
Please see the contributing guide.
Jeffrey Ryan, Joshua Ulrich