• Stars
    star
    850
  • Rank 53,628 (Top 2 %)
  • Language
    R
  • License
    Other
  • Created almost 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bringing financial analysis to the tidyverse

tidyquant

R-CMD-check codecov CRAN_Status_Badge

Bringing financial and business analysis to the tidyverse

2-Minutes To Tidyquant

Our short introduction to tidyquant on YouTube.

Anomalize

Features of Tidyquant

tidyquant integrates the best resources for collecting and analyzing financial data, zoo, xts, quantmod, TTR, and PerformanceAnalytics, with the tidy data infrastructure of the tidyverse allowing for seamless interaction between each. You can now perform complete financial analyses in the tidyverse.

  • A few core functions with a lot of power
  • Integrates the quantitative analysis functionality of zoo, xts, quantmod, TTR, and now PerformanceAnalytics
  • Designed for modeling and scaling analyses using the the tidyverse tools in R for Data Science
  • Implements ggplot2 functionality for beautiful and meaningful financial visualizations
  • User-friendly documentation to get you up to speed quickly!

New Excel Functionality in tidyquant

One-Stop Shop for Serious Financial Analysis

With tidyquant all the benefits add up to one thing: a one-stop shop for serious financial analysis!

Core Functions

  • Getting Financial Data from the web: tq_get(). This is a one-stop shop for getting web-based financial data in a “tidy” data frame format. Get data for daily stock prices (historical), key statistics (real-time), key ratios (historical), financial statements, dividends, splits, economic data from the FRED, FOREX rates from Oanda.

  • Manipulating Financial Data: tq_transmute() and tq_mutate(). Integration for many financial functions from xts, zoo, quantmod,TTR and PerformanceAnalytics packages. tq_mutate() is used to add a column to the data frame, and tq_transmute() is used to return a new data frame which is necessary for periodicity changes.

  • Performance Analysis and Portfolio Analysis: tq_performance() and tq_portfolio(). The newest additions to the tidyquant family integrate PerformanceAnalytics functions. tq_performance() converts investment returns into performance metrics. tq_portfolio() aggregates a group (or multiple groups) of asset returns into one or more portfolios.

Comparing Stock Prices

Visualizing the stock price volatility of four stocks side-by-side is quick and easy…

Evaluating Stock Performance

What about stock performance? Quickly visualize how a $10,000 investment in various stocks would perform.

Evaluating Portfolio Performance

Ok, stocks are too easy. What about portfolios? With the PerformanceAnalytics integration, visualizing blended portfolios are easy too!

  • Portfolio 1: 50% FB, 25% AMZN, 25% NFLX, 0% GOOG
  • Portfolio 2: 0% FB, 50% AMZN, 25% NFLX, 25% GOOG
  • Portfolio 3: 25% FB, 0% AMZN, 50% NFLX, 25% GOOG
  • Portfolio 4: 25% FB, 25% AMZN, 0% NFLX, 50% GOOG

This just scratches the surface of tidyquant. Here’s how to install to get started.

Installation

Development Version with Latest Features:

# install.packages("devtools")
devtools::install_github("business-science/tidyquant")

CRAN Approved Version:

install.packages("tidyquant")

Further Information

The tidyquant package includes several vignettes to help users get up to speed quickly:

Want to Learn tidyquant?

  • Learning Lab #9:

    • Performance Analysis & Portfolio Optimization with tidyquant - A 1-hour course on tidyquant in Learning Labs PRO
  • Learning Lab #10:

    • Building an API with plumber - Build a stock optimization API with plumber and tidyquant
  • Learning Lab #16:

    • Stock Portfolio Optimization and Nonlinear Programming - Use the ROI package with tidyquant to calculate optimal minimum variance portfolios and develop an efficient frontier.
  • Learning Lab #30:

    • Shiny Financial Analysis with Tidyquant API & Excel Pivot Tables - Learn how to use the new Excel Functionality to make Pivot Tables, VLOOKUPs, Sum-If’s, and more!

More Repositories

1

free_r_tips

Free R-Tips is a FREE Newsletter provided by Business Science. It comes with bite-sized code tutorials every week.
HTML
1,267
star
2

pytimetk

Time series easier, faster, more fun. Pytimetk.
Python
673
star
3

timetk

Time series analysis in the `tidyverse`
R
608
star
4

modeltime

Modeltime unlocks time series forecast models and machine learning in one framework
R
515
star
5

anomalize

Tidy anomaly detection
R
337
star
6

tibbletime

Time-aware tibbles
R
179
star
7

presentations

A central repository of Business Science presentations
HTML
165
star
8

sweep

Extending broom for time series forecasting
R
155
star
9

correlationfunnel

Speed Up Exploratory Data Analysis (EDA)
R
132
star
10

cheatsheets

101
star
11

free_python_tips

HTML
79
star
12

modeltime.ensemble

Time Series Ensemble Forecasting
R
73
star
13

alphavantager

A lightweight R interface to the Alpha Vantage API
R
69
star
14

riingo

An R interface to the Tiingo stock price API
R
51
star
15

10_python_r_business_problems

Python
48
star
16

modeltime.h2o

Forecasting with H2O AutoML. Use the H2O Automatic Machine Learning algorithm as a backend for Modeltime Time Series Forecasting.
R
40
star
17

modeltime.gluonts

GluonTS Deep Learning with Modeltime
R
39
star
18

portfoliodown

An R package for creating professional data science portfolios
CSS
37
star
19

gpu_accelerated_forecasting_modeltime_gluonts

GPU-Accelerated Deep Learning for Time Series using Modeltime GluonTS (Learning Lab 53). Event sponsors: Saturn Cloud, NVIDIA, & Business Science.
HTML
22
star
20

modeltime.resample

Resampling Tools for Time Series Forecasting with Modeltime
R
19
star
21

reports

A central repository of Business Science technical reports
17
star
22

workshop_2018_dsgo

DataScienceGO 2018 - Machine Learning Workshop
R
13
star
23

lab_59_cust_lifetime_py

Learning Lab 59: Customer Lifetime Value Python
Python
12
star
24

pymodeltime

Pymodeltime offers a unified framework tailored to address a broad spectrum of requirements, including time series forecasting and various machine learning models.
Python
12
star
25

awesome-generative-ai

A curated list of resources for building and deploying generative AI specifically focusing on helping you become a GenAI developer with LLMs
12
star
26

shinyauth

Dockerfile
Dockerfile
10
star
27

gammodels

The parsnip backend for GAM Models.
R
7
star
28

modeltime_h2o_workshop

R
6
star
29

webinar_introducing_pytimetk

Jupyter Notebook
5
star
30

lab_50_lightgbm

Learning Lab 50: Hierarchical Forecasting
R
5
star
31

free_ai_training

Free training to get you started learning AI for data science today!
Jupyter Notebook
5
star
32

workshop_timetk_data_viz

R
3
star
33

bsu-dev

Code for development of Business Science University courses.
3
star
34

lab_63_nested_modeltime

R
1
star
35

courseinfo

Course information, curriculum, and brochures
1
star