SlideShare una empresa de Scribd logo
1 de 25
Portfolio and Risk Analytics in Python with pyfolio
PyData NYC 2015
Jessica Stauth
VP Quant Strategy
Justin Lent, Thomas Weicki PhD, Andrew Campbell
#PyData #PyDataNYC 1
Why use Python for Quant Finance?
• Python is a general purpose language
• No hodge-podge of perl, bash, matlab, R, excel
fortran.
• Very easy to learn.
#PyData #PyDataNYC 2
The Quant Finance PyData Stack
• Source: [Jake VanderPlas: State of the Tools]
– (https://www.youtube.com/watch?v=5GlNDD7qbP4)#PyData #PyDataNYC 3
Python in Quantitative Finance
• When Quantopian started in 2011, we needed a backtester
– Open-sourced Zipline in 2012
• When we started to build a crowd-source hedge fund, we
needed a better way to evaluate algorithms
– Open-sourced pyfolio in 2015
#PyData #PyDataNYC 4
pyfolio
• State-of-the-art portfolio and risk analytics
http://quantopian.github.io/pyfolio/
• Open source and free: Apache v2 license
• Can be used:
– stand alone
– with Zipline
– on Quantopian in a hosted Research Environment
– with PyThalesians
#PyData #PyDataNYC 5
Using pyfolio stand-alone
• Installation
• Use Anaconda to get a Python system with the full
PyData ecosystem. Then:
• pip install pyfolio
• Import it in your project
#PyData #PyDataNYC 6
Tearsheets analysis package
Visualizations
• Daily returns of a stock, or trading strategy
• Positions
• Transactions
• Periods of market stress
• Bayesian risk analyses
#PyData #PyDataNYC 7
Tearsheet Components
#PyData #PyDataNYC 8
#PyData #PyDataNYC 9
#PyData #PyDataNYC 10
#PyData #PyDataNYC 11
#PyData #PyDataNYC 12
Long/Short Exposure over Time
#PyData #PyDataNYC 13
Sector Exposure over Time
#PyData #PyDataNYC 14
Slippage and Transaction Cost Sensitivity
#PyData #PyDataNYC 15
Zipline + pyfolio, locally or via quantopian.com
• Zipline: open-source backtester by Quantopian
• Powers quantopian.com
– 12 years of stock market data for US Equities (minute-bar
prices, corporate fundamentals, sentiment, events, etc.)
– Various models for transaction costs and slippage.
– Web based IDE for creating and deploying trading algorithms
• Hosted ipython notebook research server
– Ad-hoc data analysis. We provide market data.
– Pull in strategy backtest results from the Web IDE and use
pyfolio
#PyData #PyDataNYC 16
Bayesian analysis in pyfolio
• Sneak-peek into ongoing research.
• Can a backtest (in-sample data) be used to predict the future results
(out of sample data)?
• Sophisticated statistical modeling takes uncertainty into account.
• Uses T-distribution to model returns (instead of normal).
– Addresses ‘fat-tail’ nature of financial returns
• Relies on PyMC3.
– Python module for Bayesian statistical modeling and model fitting which
focuses on advanced Markov chain Monte Carlo fitting algorithms.
#PyData #PyDataNYC 17
Modeling Trading Strategy Uncertainty with Bayesian Analysis
How do I know my trading
strategy is “working” after I’ve
put real $ into it?
How many Out-of-Sample trading
days must be observed for me to
be certain?
Calculate: P(mean > 0)
(Probability of out-of-sample means > 0%)
Re-compute model as new data is sampled.
#PyData #PyDataNYC 18
Modeling Trading Strategy Uncertainty with Bayesian Analysis
#PyData #PyDataNYC 19
Bayesian analysis – real world example
#PyData #PyDataNYC 20
paper
trading
Bayesian analysis – real world example
#PyData #PyDataNYC 21
!
Bayesian analysis – real world example
#PyData #PyDataNYC 22
June2015
Nov2015
Backtest – “in-sample”
More Info on Bayesian Analysis
Accompanying blog post:
http://blog.quantopian.com/bayesian-cone/
Bayesian Methods for Hackers:
http://camdavidsonpilon.github.io/Probabilistic-Programming-and-
Bayesian-Methods-for-Hackers/
PyMC3: http://pymc-devs.github.io/pymc3
#PyData #PyDataNYC 23
Summary
• Pyfolio bundles various useful analyses and includes
advanced statistical modeling.
• “Using pyfolio” webinar tutorial:
https://www.youtube.com/watch?v=-VmZAlBWUko
• Still young -- please contribute:
https://github.com/quantopian/pyfolio/labels/help%2
0wanted
• Bugs: https://github.com/quantopian/pyfolio/issues
#PyData #PyDataNYC 24
Up next right here: Andrew Campbell - Bootstrapping
Applications and Dashboards with IPython Widgets
Tomorrow 4:25pm Room A: Scott Sandersen –
Developing an Expression Language for Quantitative
Financial Modeling
jstauth@quantopian.com
@jstauth
www.quantopian.com/fund
Thank you.
Questions?
#PyData #PyDataNYC 25

Más contenido relacionado

La actualidad más candente

The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...Quantopian
 
"A Framework for Developing Trading Models Based on Machine Learning" by Kris...
"A Framework for Developing Trading Models Based on Machine Learning" by Kris..."A Framework for Developing Trading Models Based on Machine Learning" by Kris...
"A Framework for Developing Trading Models Based on Machine Learning" by Kris...Quantopian
 
Should You Build Your Own Backtester? by Michael Halls-Moore at QuantCon 2016
Should You Build Your Own Backtester? by Michael Halls-Moore at QuantCon 2016Should You Build Your Own Backtester? by Michael Halls-Moore at QuantCon 2016
Should You Build Your Own Backtester? by Michael Halls-Moore at QuantCon 2016Quantopian
 
Quantopian is Launching a Crowd-sourced Hedge Fund
Quantopian is Launching a Crowd-sourced Hedge FundQuantopian is Launching a Crowd-sourced Hedge Fund
Quantopian is Launching a Crowd-sourced Hedge Fundkelmstrom
 
Case Studies in Creating Quant Models from Large Scale Unstructured Text by S...
Case Studies in Creating Quant Models from Large Scale Unstructured Text by S...Case Studies in Creating Quant Models from Large Scale Unstructured Text by S...
Case Studies in Creating Quant Models from Large Scale Unstructured Text by S...Quantopian
 
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016Quantopian
 
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ..."A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...Quantopian
 
Tearsheet feedback webinar 10.10.18
Tearsheet feedback webinar 10.10.18Tearsheet feedback webinar 10.10.18
Tearsheet feedback webinar 10.10.18Quantopian
 
"Quantum Hierarchical Risk Parity - A Quantum-Inspired Approach to Portfolio ...
"Quantum Hierarchical Risk Parity - A Quantum-Inspired Approach to Portfolio ..."Quantum Hierarchical Risk Parity - A Quantum-Inspired Approach to Portfolio ...
"Quantum Hierarchical Risk Parity - A Quantum-Inspired Approach to Portfolio ...Quantopian
 
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe..."Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...Quantopian
 
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an..."Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...Quantopian
 
Algorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa Roitman
Algorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa RoitmanAlgorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa Roitman
Algorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa RoitmanI Know First: Daily Market Forecast
 
Futures Trading Strategies on SGX - India chapter in AFACT in Singapore
Futures Trading Strategies on SGX - India chapter in AFACT in SingaporeFutures Trading Strategies on SGX - India chapter in AFACT in Singapore
Futures Trading Strategies on SGX - India chapter in AFACT in SingaporeQuantInsti
 
"Enhancing Statistical Significance of Backtests" by Dr. Ernest Chan, Managin...
"Enhancing Statistical Significance of Backtests" by Dr. Ernest Chan, Managin..."Enhancing Statistical Significance of Backtests" by Dr. Ernest Chan, Managin...
"Enhancing Statistical Significance of Backtests" by Dr. Ernest Chan, Managin...Quantopian
 
Using Domain Expertise to Improve Text Analysis, Evan Schnidman, Founder and ...
Using Domain Expertise to Improve Text Analysis, Evan Schnidman, Founder and ...Using Domain Expertise to Improve Text Analysis, Evan Schnidman, Founder and ...
Using Domain Expertise to Improve Text Analysis, Evan Schnidman, Founder and ...Quantopian
 
Risk Management: Maximising Long-Term Growth Presentation
Risk Management: Maximising Long-Term Growth PresentationRisk Management: Maximising Long-Term Growth Presentation
Risk Management: Maximising Long-Term Growth PresentationQuantInsti
 
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas..."Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...Quantopian
 
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ..."How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...Quantopian
 
Algorithmic Finance Meetup: Starmine Short Interest Talk
Algorithmic Finance Meetup: Starmine Short Interest Talk Algorithmic Finance Meetup: Starmine Short Interest Talk
Algorithmic Finance Meetup: Starmine Short Interest Talk Quantopian
 

La actualidad más candente (20)

The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
The QuantCon Keynote: "Counter Trend Trading – Threat or Complement to Trend ...
 
"A Framework for Developing Trading Models Based on Machine Learning" by Kris...
"A Framework for Developing Trading Models Based on Machine Learning" by Kris..."A Framework for Developing Trading Models Based on Machine Learning" by Kris...
"A Framework for Developing Trading Models Based on Machine Learning" by Kris...
 
Should You Build Your Own Backtester? by Michael Halls-Moore at QuantCon 2016
Should You Build Your Own Backtester? by Michael Halls-Moore at QuantCon 2016Should You Build Your Own Backtester? by Michael Halls-Moore at QuantCon 2016
Should You Build Your Own Backtester? by Michael Halls-Moore at QuantCon 2016
 
Quantopian is Launching a Crowd-sourced Hedge Fund
Quantopian is Launching a Crowd-sourced Hedge FundQuantopian is Launching a Crowd-sourced Hedge Fund
Quantopian is Launching a Crowd-sourced Hedge Fund
 
Case Studies in Creating Quant Models from Large Scale Unstructured Text by S...
Case Studies in Creating Quant Models from Large Scale Unstructured Text by S...Case Studies in Creating Quant Models from Large Scale Unstructured Text by S...
Case Studies in Creating Quant Models from Large Scale Unstructured Text by S...
 
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
 
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ..."A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
 
Tearsheet feedback webinar 10.10.18
Tearsheet feedback webinar 10.10.18Tearsheet feedback webinar 10.10.18
Tearsheet feedback webinar 10.10.18
 
"Quantum Hierarchical Risk Parity - A Quantum-Inspired Approach to Portfolio ...
"Quantum Hierarchical Risk Parity - A Quantum-Inspired Approach to Portfolio ..."Quantum Hierarchical Risk Parity - A Quantum-Inspired Approach to Portfolio ...
"Quantum Hierarchical Risk Parity - A Quantum-Inspired Approach to Portfolio ...
 
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe..."Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
 
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an..."Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
 
Algorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa Roitman
Algorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa RoitmanAlgorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa Roitman
Algorithmic Trading Latest Trends & Developments Lecture By Dr. Lipa Roitman
 
Futures Trading Strategies on SGX - India chapter in AFACT in Singapore
Futures Trading Strategies on SGX - India chapter in AFACT in SingaporeFutures Trading Strategies on SGX - India chapter in AFACT in Singapore
Futures Trading Strategies on SGX - India chapter in AFACT in Singapore
 
"Enhancing Statistical Significance of Backtests" by Dr. Ernest Chan, Managin...
"Enhancing Statistical Significance of Backtests" by Dr. Ernest Chan, Managin..."Enhancing Statistical Significance of Backtests" by Dr. Ernest Chan, Managin...
"Enhancing Statistical Significance of Backtests" by Dr. Ernest Chan, Managin...
 
Using Domain Expertise to Improve Text Analysis, Evan Schnidman, Founder and ...
Using Domain Expertise to Improve Text Analysis, Evan Schnidman, Founder and ...Using Domain Expertise to Improve Text Analysis, Evan Schnidman, Founder and ...
Using Domain Expertise to Improve Text Analysis, Evan Schnidman, Founder and ...
 
Risk Management: Maximising Long-Term Growth Presentation
Risk Management: Maximising Long-Term Growth PresentationRisk Management: Maximising Long-Term Growth Presentation
Risk Management: Maximising Long-Term Growth Presentation
 
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas..."Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
 
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ..."How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...
 
QuantConnect - Options Backtesting
QuantConnect - Options BacktestingQuantConnect - Options Backtesting
QuantConnect - Options Backtesting
 
Algorithmic Finance Meetup: Starmine Short Interest Talk
Algorithmic Finance Meetup: Starmine Short Interest Talk Algorithmic Finance Meetup: Starmine Short Interest Talk
Algorithmic Finance Meetup: Starmine Short Interest Talk
 

Destacado

Building a Quantitative Trading Strategy To Beat the S&P500
Building a Quantitative Trading Strategy To Beat the S&P500Building a Quantitative Trading Strategy To Beat the S&P500
Building a Quantitative Trading Strategy To Beat the S&P500Karen Rubin
 
An introduction to reinforcement learning (rl)
An introduction to reinforcement learning (rl)An introduction to reinforcement learning (rl)
An introduction to reinforcement learning (rl)pauldix
 
Introduction to Reinforcement Learning
Introduction to Reinforcement LearningIntroduction to Reinforcement Learning
Introduction to Reinforcement LearningEdward Balaban
 
Trade Like a Chimp: Unleash Your Inner Primate by Andreas Clenow at QuantCon ...
Trade Like a Chimp: Unleash Your Inner Primate by Andreas Clenow at QuantCon ...Trade Like a Chimp: Unleash Your Inner Primate by Andreas Clenow at QuantCon ...
Trade Like a Chimp: Unleash Your Inner Primate by Andreas Clenow at QuantCon ...Quantopian
 
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...Quantopian
 
Reinforcement Learning : A Beginners Tutorial
Reinforcement Learning : A Beginners TutorialReinforcement Learning : A Beginners Tutorial
Reinforcement Learning : A Beginners TutorialOmar Enayet
 
Dual Momentum Investing by Gary Antonacci QuantCon 2016
Dual Momentum Investing by Gary Antonacci QuantCon 2016Dual Momentum Investing by Gary Antonacci QuantCon 2016
Dual Momentum Investing by Gary Antonacci QuantCon 2016Quantopian
 
How to design quant trading strategies using “R”?
How to design quant trading strategies using “R”?How to design quant trading strategies using “R”?
How to design quant trading strategies using “R”?QuantInsti
 
Reinforcement learning
Reinforcement learning Reinforcement learning
Reinforcement learning Chandra Meena
 
Presentation on supervised learning
Presentation on supervised learningPresentation on supervised learning
Presentation on supervised learningTonmoy Bhagawati
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine LearningRahul Jain
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine LearningLior Rokach
 

Destacado (13)

Building a Quantitative Trading Strategy To Beat the S&P500
Building a Quantitative Trading Strategy To Beat the S&P500Building a Quantitative Trading Strategy To Beat the S&P500
Building a Quantitative Trading Strategy To Beat the S&P500
 
Mean Reversion
Mean ReversionMean Reversion
Mean Reversion
 
An introduction to reinforcement learning (rl)
An introduction to reinforcement learning (rl)An introduction to reinforcement learning (rl)
An introduction to reinforcement learning (rl)
 
Introduction to Reinforcement Learning
Introduction to Reinforcement LearningIntroduction to Reinforcement Learning
Introduction to Reinforcement Learning
 
Trade Like a Chimp: Unleash Your Inner Primate by Andreas Clenow at QuantCon ...
Trade Like a Chimp: Unleash Your Inner Primate by Andreas Clenow at QuantCon ...Trade Like a Chimp: Unleash Your Inner Primate by Andreas Clenow at QuantCon ...
Trade Like a Chimp: Unleash Your Inner Primate by Andreas Clenow at QuantCon ...
 
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
Statistics - The Missing Link Between Technical Analysis and Algorithmic Trad...
 
Reinforcement Learning : A Beginners Tutorial
Reinforcement Learning : A Beginners TutorialReinforcement Learning : A Beginners Tutorial
Reinforcement Learning : A Beginners Tutorial
 
Dual Momentum Investing by Gary Antonacci QuantCon 2016
Dual Momentum Investing by Gary Antonacci QuantCon 2016Dual Momentum Investing by Gary Antonacci QuantCon 2016
Dual Momentum Investing by Gary Antonacci QuantCon 2016
 
How to design quant trading strategies using “R”?
How to design quant trading strategies using “R”?How to design quant trading strategies using “R”?
How to design quant trading strategies using “R”?
 
Reinforcement learning
Reinforcement learning Reinforcement learning
Reinforcement learning
 
Presentation on supervised learning
Presentation on supervised learningPresentation on supervised learning
Presentation on supervised learning
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 

Similar a PyData NYC 2015

Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Simplilearn
 
"Applying Deep Learning Techniques to Financial Time Series" by Scott Treloar...
"Applying Deep Learning Techniques to Financial Time Series" by Scott Treloar..."Applying Deep Learning Techniques to Financial Time Series" by Scott Treloar...
"Applying Deep Learning Techniques to Financial Time Series" by Scott Treloar...Quantopian
 
Accelerating and financing London’s start ups
 Accelerating and financing London’s start ups Accelerating and financing London’s start ups
Accelerating and financing London’s start upsCapitalEnterpriseLDN
 
No, you don't need to learn python
No, you don't need to learn pythonNo, you don't need to learn python
No, you don't need to learn pythonQuantUniversity
 
Productive Data Tools for Quants
Productive Data Tools for QuantsProductive Data Tools for Quants
Productive Data Tools for QuantsWes McKinney
 
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALSPYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALSQuantUniversity
 
Machine Learning with PyCaret
Machine Learning with PyCaretMachine Learning with PyCaret
Machine Learning with PyCaretDatabricks
 
Introduction To Data Science With Python
Introduction To Data Science With PythonIntroduction To Data Science With Python
Introduction To Data Science With PythonSpotle.ai
 
Get Started with Quantiacs
Get Started with QuantiacsGet Started with Quantiacs
Get Started with QuantiacsQuantiacs
 
Python Certification | Data Science with Python Certification | Python Online...
Python Certification | Data Science with Python Certification | Python Online...Python Certification | Data Science with Python Certification | Python Online...
Python Certification | Data Science with Python Certification | Python Online...Edureka!
 
American Century (Revolution Analytics Customer Day)
American Century (Revolution Analytics Customer Day)American Century (Revolution Analytics Customer Day)
American Century (Revolution Analytics Customer Day)Revolution Analytics
 
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...WG_ Events
 
Pinterest - Big Data Machine Learning Platform at Pinterest
Pinterest - Big Data Machine Learning Platform at PinterestPinterest - Big Data Machine Learning Platform at Pinterest
Pinterest - Big Data Machine Learning Platform at PinterestAlluxio, Inc.
 
Defcon Blue Team Village 2020: Purple On My Mind: Cost Effective Automated Ad...
Defcon Blue Team Village 2020: Purple On My Mind: Cost Effective Automated Ad...Defcon Blue Team Village 2020: Purple On My Mind: Cost Effective Automated Ad...
Defcon Blue Team Village 2020: Purple On My Mind: Cost Effective Automated Ad...Mauricio Velazco
 
A Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source AdventureA Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source AdventureNick Kridler
 
🌟Is Learning Python Your Career Game-Changer? 🚀🐍
🌟Is Learning Python Your  Career Game-Changer? 🚀🐍🌟Is Learning Python Your  Career Game-Changer? 🚀🐍
🌟Is Learning Python Your Career Game-Changer? 🚀🐍abhishekdf3
 
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)Austin Ogilvie
 
Innovative Data Leveraging for Procurement Analytics
Innovative Data Leveraging for Procurement AnalyticsInnovative Data Leveraging for Procurement Analytics
Innovative Data Leveraging for Procurement AnalyticsTejari
 

Similar a PyData NYC 2015 (20)

Python ml
Python mlPython ml
Python ml
 
Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...
 
"Applying Deep Learning Techniques to Financial Time Series" by Scott Treloar...
"Applying Deep Learning Techniques to Financial Time Series" by Scott Treloar..."Applying Deep Learning Techniques to Financial Time Series" by Scott Treloar...
"Applying Deep Learning Techniques to Financial Time Series" by Scott Treloar...
 
Accelerating and financing London’s start ups
 Accelerating and financing London’s start ups Accelerating and financing London’s start ups
Accelerating and financing London’s start ups
 
No, you don't need to learn python
No, you don't need to learn pythonNo, you don't need to learn python
No, you don't need to learn python
 
Productive Data Tools for Quants
Productive Data Tools for QuantsProductive Data Tools for Quants
Productive Data Tools for Quants
 
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALSPYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
 
Machine Learning with PyCaret
Machine Learning with PyCaretMachine Learning with PyCaret
Machine Learning with PyCaret
 
Introduction To Data Science With Python
Introduction To Data Science With PythonIntroduction To Data Science With Python
Introduction To Data Science With Python
 
Get Started with Quantiacs
Get Started with QuantiacsGet Started with Quantiacs
Get Started with Quantiacs
 
Get Started with Quantiacs
Get Started with QuantiacsGet Started with Quantiacs
Get Started with Quantiacs
 
Python Certification | Data Science with Python Certification | Python Online...
Python Certification | Data Science with Python Certification | Python Online...Python Certification | Data Science with Python Certification | Python Online...
Python Certification | Data Science with Python Certification | Python Online...
 
American Century (Revolution Analytics Customer Day)
American Century (Revolution Analytics Customer Day)American Century (Revolution Analytics Customer Day)
American Century (Revolution Analytics Customer Day)
 
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
 
Pinterest - Big Data Machine Learning Platform at Pinterest
Pinterest - Big Data Machine Learning Platform at PinterestPinterest - Big Data Machine Learning Platform at Pinterest
Pinterest - Big Data Machine Learning Platform at Pinterest
 
Defcon Blue Team Village 2020: Purple On My Mind: Cost Effective Automated Ad...
Defcon Blue Team Village 2020: Purple On My Mind: Cost Effective Automated Ad...Defcon Blue Team Village 2020: Purple On My Mind: Cost Effective Automated Ad...
Defcon Blue Team Village 2020: Purple On My Mind: Cost Effective Automated Ad...
 
A Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source AdventureA Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source Adventure
 
🌟Is Learning Python Your Career Game-Changer? 🚀🐍
🌟Is Learning Python Your  Career Game-Changer? 🚀🐍🌟Is Learning Python Your  Career Game-Changer? 🚀🐍
🌟Is Learning Python Your Career Game-Changer? 🚀🐍
 
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
Building a Beer Recommender with Yhat (PAPIs.io - November 2014)
 
Innovative Data Leveraging for Procurement Analytics
Innovative Data Leveraging for Procurement AnalyticsInnovative Data Leveraging for Procurement Analytics
Innovative Data Leveraging for Procurement Analytics
 

Último

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Último (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

PyData NYC 2015

  • 1. Portfolio and Risk Analytics in Python with pyfolio PyData NYC 2015 Jessica Stauth VP Quant Strategy Justin Lent, Thomas Weicki PhD, Andrew Campbell #PyData #PyDataNYC 1
  • 2. Why use Python for Quant Finance? • Python is a general purpose language • No hodge-podge of perl, bash, matlab, R, excel fortran. • Very easy to learn. #PyData #PyDataNYC 2
  • 3. The Quant Finance PyData Stack • Source: [Jake VanderPlas: State of the Tools] – (https://www.youtube.com/watch?v=5GlNDD7qbP4)#PyData #PyDataNYC 3
  • 4. Python in Quantitative Finance • When Quantopian started in 2011, we needed a backtester – Open-sourced Zipline in 2012 • When we started to build a crowd-source hedge fund, we needed a better way to evaluate algorithms – Open-sourced pyfolio in 2015 #PyData #PyDataNYC 4
  • 5. pyfolio • State-of-the-art portfolio and risk analytics http://quantopian.github.io/pyfolio/ • Open source and free: Apache v2 license • Can be used: – stand alone – with Zipline – on Quantopian in a hosted Research Environment – with PyThalesians #PyData #PyDataNYC 5
  • 6. Using pyfolio stand-alone • Installation • Use Anaconda to get a Python system with the full PyData ecosystem. Then: • pip install pyfolio • Import it in your project #PyData #PyDataNYC 6
  • 7. Tearsheets analysis package Visualizations • Daily returns of a stock, or trading strategy • Positions • Transactions • Periods of market stress • Bayesian risk analyses #PyData #PyDataNYC 7
  • 13. Long/Short Exposure over Time #PyData #PyDataNYC 13
  • 14. Sector Exposure over Time #PyData #PyDataNYC 14
  • 15. Slippage and Transaction Cost Sensitivity #PyData #PyDataNYC 15
  • 16. Zipline + pyfolio, locally or via quantopian.com • Zipline: open-source backtester by Quantopian • Powers quantopian.com – 12 years of stock market data for US Equities (minute-bar prices, corporate fundamentals, sentiment, events, etc.) – Various models for transaction costs and slippage. – Web based IDE for creating and deploying trading algorithms • Hosted ipython notebook research server – Ad-hoc data analysis. We provide market data. – Pull in strategy backtest results from the Web IDE and use pyfolio #PyData #PyDataNYC 16
  • 17. Bayesian analysis in pyfolio • Sneak-peek into ongoing research. • Can a backtest (in-sample data) be used to predict the future results (out of sample data)? • Sophisticated statistical modeling takes uncertainty into account. • Uses T-distribution to model returns (instead of normal). – Addresses ‘fat-tail’ nature of financial returns • Relies on PyMC3. – Python module for Bayesian statistical modeling and model fitting which focuses on advanced Markov chain Monte Carlo fitting algorithms. #PyData #PyDataNYC 17
  • 18. Modeling Trading Strategy Uncertainty with Bayesian Analysis How do I know my trading strategy is “working” after I’ve put real $ into it? How many Out-of-Sample trading days must be observed for me to be certain? Calculate: P(mean > 0) (Probability of out-of-sample means > 0%) Re-compute model as new data is sampled. #PyData #PyDataNYC 18
  • 19. Modeling Trading Strategy Uncertainty with Bayesian Analysis #PyData #PyDataNYC 19
  • 20. Bayesian analysis – real world example #PyData #PyDataNYC 20 paper trading
  • 21. Bayesian analysis – real world example #PyData #PyDataNYC 21 !
  • 22. Bayesian analysis – real world example #PyData #PyDataNYC 22 June2015 Nov2015 Backtest – “in-sample”
  • 23. More Info on Bayesian Analysis Accompanying blog post: http://blog.quantopian.com/bayesian-cone/ Bayesian Methods for Hackers: http://camdavidsonpilon.github.io/Probabilistic-Programming-and- Bayesian-Methods-for-Hackers/ PyMC3: http://pymc-devs.github.io/pymc3 #PyData #PyDataNYC 23
  • 24. Summary • Pyfolio bundles various useful analyses and includes advanced statistical modeling. • “Using pyfolio” webinar tutorial: https://www.youtube.com/watch?v=-VmZAlBWUko • Still young -- please contribute: https://github.com/quantopian/pyfolio/labels/help%2 0wanted • Bugs: https://github.com/quantopian/pyfolio/issues #PyData #PyDataNYC 24
  • 25. Up next right here: Andrew Campbell - Bootstrapping Applications and Dashboards with IPython Widgets Tomorrow 4:25pm Room A: Scott Sandersen – Developing an Expression Language for Quantitative Financial Modeling jstauth@quantopian.com @jstauth www.quantopian.com/fund Thank you. Questions? #PyData #PyDataNYC 25