Skip to content

Commit 89d1fb4

Browse files
committed
readme update
1 parent 95e47d4 commit 89d1fb4

File tree

16 files changed

+620
-250
lines changed

16 files changed

+620
-250
lines changed

01_machine_learning_for_trading/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ Historically, algorithmic trading used to be more narrowly defined as the automa
1616

1717
This chapter looks at industry trends that have led to the emergence of ML as a source of competitive advantage in the investment industry. We will also look at where ML fits into the investment process to enable algorithmic trading strategies.
1818

19-
More specifically, we will be covering the following topics:
20-
21-
#### Table of contents
19+
## Content
2220

2321
1. [The rise of ML in the investment industry](#the-rise-of-ml-in-the-investment-industry)
2422
* [From electronic to high-frequency trading](#from-electronic-to-high-frequency-trading)

02_market_and_fundamental_data/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ This chapter introduces market and fundamental data sources and explains how the
1212

1313
## Content
1414

15-
#### Table of contents
16-
1715
1. [Market data reflects the trading environment](#market-data-reflects-the-trading-environment)
1816
* [Market microstructure: The nuts and bolts of trading](#market-microstructure-the-nuts-and-bolts-of-trading)
1917
2. [Working with high-frequency market data](#working-with-high-frequency-market-data)

03_alternative_data/README.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ It demonstrates the workflow, from acquisition to preprocessing and storage usin
1212
- How to work with alternative data in Python, such as by scraping the internet
1313
- Important categories and providers of alternative data
1414

15+
## Content
16+
17+
1. [The Alternative Data Revolution](#the-alternative-data-revolution)
18+
* [Resources](#resources)
19+
2. [Sources of alternative data](#sources-of-alternative-data)
20+
3. [Criteria for evaluating alternative datasets](#criteria-for-evaluating-alternative-datasets)
21+
* [Resources](#resources-2)
22+
4. [The Market for Alternative Data](#the-market-for-alternative-data)
23+
5. [Working with Alternative Data](#working-with-alternative-data)
24+
* [Code Example: Open Table Web Scraping](#code-example-open-table-web-scraping)
25+
* [Code Example: SeekingAlpha Earnings Transcripts](#code-example-seekingalpha-earnings-transcripts)
26+
* [Python Libraries & Documentation](#python-libraries--documentation)
27+
1528
## The Alternative Data Revolution
1629

1730
For algorithmic trading, new data sources offer an informational advantage if they provide access to information unavailable from traditional sources, or provide access sooner. Following global trends, the investment industry is rapidly expanding beyond market and fundamental data to alternative sources to reap alpha through an informational edge. Annual spending on data, technological capabilities, and related talent are expected to increase from the current $3 billion by 12.8% annually through 2020.
@@ -27,7 +40,18 @@ Today, investors can access macro or company-specific data in real-time that his
2740
- [Big data: The next frontier for innovation, competition, and productivity](https://www.mckinsey.com/business-functions/digital-mckinsey/our-insights/big-data-the-next-frontier-for-innovation), McKinsey 2011
2841
- [McKinsey on Artificial Intelligence](https://www.mckinsey.com/featured-insights/artificial-intelligence)
2942

30-
## Evaluating Alternative Datasets
43+
## Sources of alternative data
44+
45+
Alternative datasets are generated by many sources but can be classified at a high level as predominantly produced by:
46+
- Individuals who post on social media, review products, or use search engines
47+
- Businesses that record commercial transactions, in particular, credit card payments, or capture supply-chain activity as intermediaries
48+
- Sensors that, among many other things, capture economic activity through images such as satellites or security cameras, or through movement patterns such as cell phone towers
49+
50+
The nature of alternative data continues to evolve rapidly as new data sources become available and sources previously labeled “alternative” become part of the mainstream. The Baltic Dry Index (BDI), for instance, assembles data from several hundred shipping companies to approximate the supply/demand of dry bulk carriers and is now available on the Bloomberg Terminal.
51+
52+
Alternative data sources differ in crucial respects that determine their value or signal content for algorithmic trading strategies.
53+
54+
## Criteria for evaluating alternative datasets
3155

3256
The ultimate objective of alternative data is to provide an informational advantage in the competitive search for trading signals that produce alpha, namely positive, uncorrelated investment returns. In practice, the signals extracted from alternative datasets can be used on a standalone basis or combined with other signals as part of a quantitative strategy.
3357

@@ -48,17 +72,17 @@ This section illustrates the acquisition of alternative data using web scraping,
4872
- [Quantifying Trading Behavior in Financial Markets Using Google Trends](https://www.nature.com/articles/srep01684), Preis, Moat and Stanley, Nature, 2013
4973
- [Quantifying StockTwits semantic terms’ trading behavior in financial markets: An effective application of decision tree algorithms](https://www.sciencedirect.com/science/article/pii/S0957417415005473), Al Nasseri et al, Expert Systems with Applications, 2015
5074

51-
#### Open Table Web Scraping
75+
### Code Example: Open Table Web Scraping
5276

5377
This subfolder [01_opentable](01_opentable) contains the script [opentable_selenium](01_opentable/opentable_selenium.py) to scrape OpenTable data using Scrapy and Selenium.
5478

5579
- [How to View the Source Code of a Web Page in Every Browser](https://www.lifewire.com/view-web-source-code-4151702)
5680

57-
#### SeekingAlpha Earnings Transcripts
81+
### Code Example: SeekingAlpha Earnings Transcripts
5882

5983
The subfolder [02_earnings_calls](02_earnings_calls) contains the script [sa_selenium](02_earnings_calls/sa_selenium.py) to scrape earnings call transcripts from the [SeekingAlpha](www.seekingalpha.com) website.
6084

61-
#### Python Libraries & Documentation
85+
## Python Libraries & Documentation
6286
- requests [docs](http://docs.python-requests.org/en/master/)
6387
- beautifulsoup [docs](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)
6488
- Selenium [docs](https://www.seleniumhq.org/)

04_alpha_factor_research/README.md

+38-31
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,35 @@ In particular, this chapter will address the following topics:
1717

1818
Please see the [Appendix - Alpha Factor Library](../24_alpha_factor_library) for additional material on this topic, including numerous code examples that compute a broad range of alpha factors.
1919

20+
## Content
21+
22+
1. [Alpha Factors in practice: from data to signals](#alpha-factors-in-practice-from-data-to-signals)
23+
2. [Building on Decades of Factor Research](#building-on-decades-of-factor-research)
24+
* [References](#references)
25+
3. [Engineering alpha factors that predict returns](#engineering-alpha-factors-that-predict-returns)
26+
* [Code Example: How to engineer factors using pandas and NumPy](#code-example-how-to-engineer-factors-using-pandas-and-numpy)
27+
* [Code Example: How to use TA-Lib to create technical alpha factors](#code-example-how-to-use-ta-lib-to-create-technical-alpha-factors)
28+
* [Code Example: How to denoise your Alpha Factors with the Kalman Filter](#code-example-how-to-denoise-your-alpha-factors-with-the-kalman-filter)
29+
* [Code Example: How to preprocess your noisy signals using Wavelets](#code-example-how-to-preprocess-your-noisy-signals-using-wavelets)
30+
* [Resources](#resources)
31+
4. [From signals to trades: backtesting with `Zipline`](#from-signals-to-trades-backtesting-with-zipline)
32+
* [Code Example: How to use Zipline to backtest a single-factor strategy](#code-example-how-to-use-zipline-to-backtest-a-single-factor-strategy)
33+
* [Code Example: Combining factors from diverse data sources on the Quantopian platform](#code-example-combining-factors-from-diverse-data-sources-on-the-quantopian-platform)
34+
* [Code Example: Separating signal and noise – how to use alphalens](#code-example-separating-signal-and-noise--how-to-use-alphalens)
35+
5. [Alternative Algorithmic Trading Libraries and Platforms](#alternative-algorithmic-trading-libraries-and-platforms)
36+
2037
## Alpha Factors in practice: from data to signals
2138

2239
Alpha factors are transformations of market, fundamental, and alternative data that contain predictive signals. They are designed to capture risks that drive asset returns. One set of factors describes fundamental, economy-wide variables such as growth, inflation, volatility, productivity, and demographic risk. Another set consists of tradeable investment styles such as the market portfolio, value-growth investing, and momentum investing.
2340

2441
There are also factors that explain price movements based on the economics or institutional setting of financial markets, or investor behavior, including known biases of this behavior. The economic theory behind factors can be rational, where the factors have high returns over the long run to compensate for their low returns during bad times, or behavioral, where factor risk premiums result from the possibly biased, or not entirely rational behavior of agents that is not arbitraged away.
2542

26-
### On the shoulders of giants: meet the factor establishment
43+
## Building on Decades of Factor Research
2744

2845
In an idealized world, categories of risk factors should be independent of each other (orthogonal), yield positive risk premia, and form a complete set that spans all dimensions of risk and explains the systematic risks for assets in a given class. In practice, these requirements will hold only approximately.
2946

47+
### References
48+
3049
- [Dissecting Anomalies](http://schwert.ssb.rochester.edu/f532/ff_JF08.pdf) by Eugene Fama and Ken French (2008)
3150
- [Explaining Stock Returns: A Literature Review](https://www.ifa.com/pdfs/explainingstockreturns.pdf) by James L. Davis (2001)
3251
- [Market Efficiency, Long-Term Returns, and Behavioral Finance](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=15108) by Eugene Fama (1997)
@@ -43,18 +62,6 @@ Based on a conceptual understanding of key factor categories, their rationale an
4362

4463
The notebook [feature_engineering.ipynb](00_data/feature_engineering.ipynb) in the [data](00_data) directory illustrates how to engineer basic factors.
4564

46-
#### Additional Resources
47-
48-
- [Fama French](https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html) Data Library
49-
- [numpy](https://numpy.org/) website
50-
- [Quickstart Tutorial](https://numpy.org/devdocs/user/quickstart.html)
51-
- [pandas](https://pandas.pydata.org/) website
52-
- [User Guide](https://pandas.pydata.org/docs/user_guide/index.html)
53-
- [10 minutes to pandas](https://pandas.pydata.org/pandas-docs/stable/getting_started/10min.html)
54-
- [Python Pandas Tutorial: A Complete Introduction for Beginners](https://www.learndatasci.com/tutorials/python-pandas-tutorial-complete-introduction-for-beginners/)
55-
- [alphatools](https://github.com/marketneutral/alphatools) - Quantitative finance research tools in Python
56-
- [mlfinlab](https://github.com/hudson-and-thames/mlfinlab) - Package based on the work of Dr Marcos Lopez de Prado regarding his research with respect to Advances in Financial Machine Learning
57-
5865
### Code Example: How to use TA-Lib to create technical alpha factors
5966

6067
The notebook [how_to_use_talib](02_how_to_use_talib.ipynb) illustrates the usage of TA-Lib, which includes a broad range of common technical indicators. These indicators have in common that they only use market data, i.e., price and volume information.
@@ -65,41 +72,40 @@ The notebook [common_alpha_factors](../24_alpha_factor_library/02_common_alpha_f
6572

6673
The notebook [kalman_filter_and_wavelets](03_kalman_filter_and_wavelets.ipynb) demonstrates the use of the Kalman filter using the `PyKalman` package for smoothing; we will also use it in [Chapter 9](../09_time_series_models) when we develop a pairs trading strategy.
6774

68-
#### Additional Resources
69-
70-
- [PyKalman](https://pykalman.github.io/) documentation
71-
- [Tutorial: The Kalman Filter](http://web.mit.edu/kirtley/kirtley/binlustuff/literature/control/Kalman%20filter.pdf)
72-
- [Understanding and Applying Kalman Filtering](http://biorobotics.ri.cmu.edu/papers/sbp_papers/integrated3/kleeman_kalman_basics.pdf)
73-
- [How a Kalman filter works, in pictures](https://www.bzarg.com/p/how-a-kalman-filter-works-in-pictures/)
74-
7575
### Code Example: How to preprocess your noisy signals using Wavelets
7676

7777
The notebook [kalman_filter_and_wavelets](03_kalman_filter_and_wavelets.ipynb) also demonstrates how to work with wavelets using the `PyWavelets` package.
7878

79-
#### Additional Resources
79+
### Resources
8080

81+
- [Fama French](https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html) Data Library
82+
- [numpy](https://numpy.org/) website
83+
- [Quickstart Tutorial](https://numpy.org/devdocs/user/quickstart.html)
84+
- [pandas](https://pandas.pydata.org/) website
85+
- [User Guide](https://pandas.pydata.org/docs/user_guide/index.html)
86+
- [10 minutes to pandas](https://pandas.pydata.org/pandas-docs/stable/getting_started/10min.html)
87+
- [Python Pandas Tutorial: A Complete Introduction for Beginners](https://www.learndatasci.com/tutorials/python-pandas-tutorial-complete-introduction-for-beginners/)
88+
- [alphatools](https://github.com/marketneutral/alphatools) - Quantitative finance research tools in Python
89+
- [mlfinlab](https://github.com/hudson-and-thames/mlfinlab) - Package based on the work of Dr Marcos Lopez de Prado regarding his research with respect to Advances in Financial Machine Learning
90+
- [PyKalman](https://pykalman.github.io/) documentation
91+
- [Tutorial: The Kalman Filter](http://web.mit.edu/kirtley/kirtley/binlustuff/literature/control/Kalman%20filter.pdf)
92+
- [Understanding and Applying Kalman Filtering](http://biorobotics.ri.cmu.edu/papers/sbp_papers/integrated3/kleeman_kalman_basics.pdf)
93+
- [How a Kalman filter works, in pictures](https://www.bzarg.com/p/how-a-kalman-filter-works-in-pictures/)
8194
- [PyWavelets](https://pywavelets.readthedocs.io/en/latest/) - Wavelet Transforms in Python
8295
- [An Introduction to Wavelets](https://www.eecis.udel.edu/~amer/CISC651/IEEEwavelet.pdf)
8396
- [The Wavelet Tutorial](http://web.iitd.ac.in/~sumeet/WaveletTutorial.pdf)
8497
- [Wavelets for Kids](http://www.gtwavelet.bme.gatech.edu/wp/kidsA.pdf)
85-
86-
### References
87-
8898
- [The Barra Equity Risk Model Handbook](https://www.alacra.com/alacra/help/barra_handbook_GEM.pdf)
8999
- [Active Portfolio Management: A Quantitative Approach for Producing Superior Returns and Controlling Risk](https://www.amazon.com/Active-Portfolio-Management-Quantitative-Controlling/dp/0070248826) by Richard Grinold and Ronald Kahn, 1999
90100
- [Modern Investment Management: An Equilibrium Approach](https://www.amazon.com/Modern-Investment-Management-Equilibrium-Approach/dp/0471124109) by Bob Litterman, 2003
91101
- [Quantitative Equity Portfolio Management: Modern Techniques and Applications](https://www.crcpress.com/Quantitative-Equity-Portfolio-Management-Modern-Techniques-and-Applications/Qian-Hua-Sorensen/p/book/9781584885580) by Edward Qian, Ronald Hua, and Eric Sorensen
92102
- [Spearman Rank Correlation](https://statistics.laerd.com/statistical-guides/spearmans-rank-order-correlation-statistical-guide.php)
93103

94-
## From signals to trades: backtesting with `zipline`
104+
## From signals to trades: backtesting with `Zipline`
95105

96106
The open source [zipline](http://www.zipline.io/index.html) library is an event-driven backtesting system maintained and used in production by the crowd-sourced quantitative investment fund [Quantopian](https://www.quantopian.com/) to facilitate algorithm-development and live-trading. It automates the algorithm's reaction to trade events and provides it with current and historical point-in-time data that avoids look-ahead bias.
97107

98-
[Chapter 8](../08_ml4t_workflow) contains a more comprehensive introduction to Zipline.
99-
100-
### Installation
101-
- The current release 1.3 has a few shortcomings such as the [dependency on benchmark data from the IEX exchange](https://github.com/quantopian/zipline/issues/2480) and limitations for importing features beyond the basic OHLCV data points.
102-
- To enable the use of `zipline`, I've provided a [patched version](https://github.com/stefan-jansen/zipline) that works for the purposes of this book.
108+
- [Chapter 8](../08_ml4t_workflow) contains a more comprehensive introduction to Zipline.
103109
- Please follow the [instructions](../installation) in the `installation` folder.
104110

105111
### Code Example: How to use Zipline to backtest a single-factor strategy
@@ -127,10 +133,11 @@ The analysis can be conducted using `tearsheets` or individual computations and
127133

128134
- See [here](https://github.com/quantopian/alphalens/blob/master/alphalens/examples/alphalens_tutorial_on_quantopian.ipynb) for a detailed `alphalens` tutorial by Quantopian
129135

130-
### Alternative Algorithmic Trading Libraries
136+
## Alternative Algorithmic Trading Libraries and Platforms
131137

132138
- [QuantConnect](https://www.quantconnect.com/)
133139
- [Alpha Trading Labs](https://www.alphalabshft.com/)
140+
- Alpha Trading Labs is no longer active
134141
- [WorldQuant](https://www.worldquantvrc.com/en/cms/wqc/home/)
135142
- Python Algorithmic Trading Library [PyAlgoTrade](http://gbeced.github.io/pyalgotrade/)
136143
- [pybacktest](https://github.com/ematvey/pybacktest)

0 commit comments

Comments
 (0)