Download the full version of the textbook now at textbookfull.
com
Machine Learning for Algorithmic Trading 2nd
Edition Stefan Jansen
https://textbookfull.com/product/machine-learning-
for-algorithmic-trading-2nd-edition-stefan-jansen/
Explore and download more textbook at https://textbookfull.com
Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.
Machine Learning for Algorithmic Trading 2nd Edition
Stefan Jansen
https://textbookfull.com/product/machine-learning-for-algorithmic-
trading-2nd-edition-stefan-jansen-2/
textbookfull.com
Machine Learning for Algorithmic Trading 2nd Edition
Stefan Jansen
https://textbookfull.com/product/machine-learning-for-algorithmic-
trading-2nd-edition-stefan-jansen-3/
textbookfull.com
Algorithmic Trading Methods: Applications Using Advanced
Statistics, Optimization, and Machine Learning Techniques
2nd Edition Robert Kissell
https://textbookfull.com/product/algorithmic-trading-methods-
applications-using-advanced-statistics-optimization-and-machine-
learning-techniques-2nd-edition-robert-kissell/
textbookfull.com
Collaborative Therapy and Neurobiology Evolving Practices
in Action 1st Edition Marie-Nathalie Beaudoin
https://textbookfull.com/product/collaborative-therapy-and-
neurobiology-evolving-practices-in-action-1st-edition-marie-nathalie-
beaudoin/
textbookfull.com
Trade Facilitation in the Multilateral Trading System
Genesis Course and Accord 1st Edition Hao Wu
https://textbookfull.com/product/trade-facilitation-in-the-
multilateral-trading-system-genesis-course-and-accord-1st-edition-hao-
wu/
textbookfull.com
Case Analyses for Abnormal Psychology 2nd ed Learning to
Look Beyond the Symptoms 2nd Edition Randall E. Osborne
https://textbookfull.com/product/case-analyses-for-abnormal-
psychology-2nd-ed-learning-to-look-beyond-the-symptoms-2nd-edition-
randall-e-osborne/
textbookfull.com
Advanced English Grammar: A Linguistic Approach Ilse
Depraetere
https://textbookfull.com/product/advanced-english-grammar-a-
linguistic-approach-ilse-depraetere/
textbookfull.com
Chemical Analysis of Food: Techniques and Applications 2nd
Edition Yolanda Pico (Editor)
https://textbookfull.com/product/chemical-analysis-of-food-techniques-
and-applications-2nd-edition-yolanda-pico-editor/
textbookfull.com
Optical Inspection of Microsystems First Edition Wolfgang
Osten(Editor)
https://textbookfull.com/product/optical-inspection-of-microsystems-
first-edition-wolfgang-osteneditor/
textbookfull.com
Emerging Technologies in Food Science Focus on the
Developing World Monika Thakur
https://textbookfull.com/product/emerging-technologies-in-food-
science-focus-on-the-developing-world-monika-thakur/
textbookfull.com
Machine Learning for
Algorithmic Trading
Second Edition
Predictive models to extract signals from market and
alternative data for systematic trading strategies with
Python
Stefan Jansen
BIRMINGHAM - MUMBAI
Machine Learning for Algorithmic
Trading
Second Edition
Copyright © 2020 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored
in a retrieval system, or transmitted in any form or by any means,
without the prior written permission of the publisher, except in the
case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure
the accuracy of the information presented. However, the information
contained in this book is sold without warranty, either express or
implied. Neither the author, nor Packt Publishing or its dealers and
distributors, will be held liable for any damages caused or alleged to
have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information
about all of the companies and products mentioned in this book by
the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.
Producer: Tushar Gupta
Acquisition Editor – Peer Reviews: Suresh Jain
Content Development Editor: Chris Nelson
Technical Editor: Aniket Shetty
Project Editor: Carol Lewis
Copy Editor: Safis Editing
Proofreader: Safis Editing
Indexer: Priyanka Dhadke
Presentation Designer: Pranit Padwal
First published: December 2018
Second edition: July 2020
Production reference: 1300720
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-83921-771-5
www.packt.com
packt.com
Subscribe to our online digital library for full access to over 7,000
books and videos, as well as industry leading tools to help you plan
your personal development and advance your career. For more
information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical
eBooks and Videos from over 4,000 industry professionals
Learn better with Skill Plans built especially for you
Get a free eBook or video every month
Fully searchable for easy access to vital information
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade to
the eBook version at www.Packt.com and as a print book customer,
you are entitled to a discount on the eBook copy. Get in touch with
us at [email protected] for more details.
At www.Packt.com, you can also read a collection of free technical
articles, sign up for a range of free newsletters, and receive exclusive
discounts and offers on Packt books and eBooks.
Contributors
About the author
Stefan Jansen is the founder and CEO of Applied AI. He advises
Fortune 500 companies, investment firms, and start-ups across
industries on data and AI strategy, building data science teams, and
developing end-to-end machine learning solutions for a broad range
of business problems.
Before his current venture, he was a partner and managing director
at an international investment firm, where he built the predictive
analytics and investment research practice. He was also a senior
executive at a global fintech company with operations in 15 markets,
advised central banks in emerging markets, and consulted for the
World Bank.
He holds master's degrees in computer science from Georgia Tech
and in economics from Harvard and Free University Berlin, and a
CFA charter. He has worked in six languages across Europe, Asia,
and the Americas and taught data science at DataCamp and General
Assembly.
This thorough revision of the first edition was only possible with the
collaboration and support of my family, friends, and colleagues. I want to
thank the team at Packt for responding to reader feedback and taking the
project from start to finish. Chris Nelson was a thorough editor and
provided constructive advice. I want to thank my clients for the opportunity
to do such exciting work that often offered valuable inspiration for this book.
Most important, however, has been the unrelenting patience and support of
Mariana. To her and Bastian, who make it all worthwhile, I dedicate this
book.
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
About the reviewers
Prem Jebaseelan has about 20 years of experience in handling
different financial data and enjoys the challenge of organizing,
storing, retrieving, and analyzing large volumes of data. Prem has
designed and implemented several enterprise-level solutions for
front office trading strategies, middle office, and back office
applications for funds, and has good experience in applying
machine learning and AI-based solutions. Prem has an engineering
degree.
Prem is currently the co-founder and CEO of Zentropy Technologies,
a fintech company that specializes in creating machine learning
based solutions in the financial domain. Prior to this, Prem worked
in one of the leading hedge funds as a technology solutions
provider.
I would like to thank all my previous employers who have helped me in
developing real-world solutions that bring technology and finance together.
I would specifically like to thank Dr Yves Hilpisch for our work together in
the application of machine learning to real-world trading strategies.
Ramanathan Ramakrishnamoorthy is one of the co founders and
directors at Zentropy Technologies. Ramanathan started his
professional career with a leading hedge fund and in his latest
position, he worked as a project manager responsible for building
tools and technologies required by the middle and back office. At
Zentropy, Ramanathan is primarily responsible for better
understanding project requirements and converting them to
technical specs. alongside executing them. Having a keen eye for
subtle data patterns, Ramanathan also has a good understanding of
the machine learning and data science domain, particularly with
expertise in the time series analysis domain. Ramanathan's
experience has primarily been around building trading systems,
quant warehouses, and backtesting engines for capital markets.
Ramanathan is also an active core group member in the Hyderabad
Python group. He leads some of the most important activities of the
community, like organizing conferences, monthly meetups, and
conducting Python sessions at colleges.
Contents
Preface
What to expect
What's new in the second edition
Who should read this book
What this book covers
To get the most out of this book
Get in touch
1. Machine Learning for Trading – From Idea to Execution
The rise of ML in the investment industry
From electronic to high-frequency trading
Factor investing and smart beta funds
Algorithmic pioneers outperform humans
ML-driven funds attract $1 trillion in AUM
The emergence of quantamental funds
Investments in strategic capabilities
ML and alternative data
Crowdsourcing trading algorithms
Designing and executing an ML-driven strategy
Sourcing and managing data
From alpha factor research to portfolio management
The research phase
The execution phase
Strategy backtesting
ML for trading – strategies and use cases
The evolution of algorithmic strategies
Use cases of ML for trading
Data mining for feature extraction and insights
Supervised learning for alpha factor creation
Asset allocation
Testing trade ideas
Reinforcement learning
Summary
2. Market and Fundamental Data – Sources and Techniques
Market data reflects its environment
Market microstructure – the nuts and bolts
How to trade – different types of orders
Where to trade – from exchanges to dark pools
Working with high-frequency data
How to work with Nasdaq order book data
Communicating trades with the FIX protocol
The Nasdaq TotalView-ITCH data feed
How to parse binary order messages
Summarizing the trading activity for all 8,500
stocks
How to reconstruct all trades and the order book
From ticks to bars – how to regularize market data
The raw material – tick bars
Plain-vanilla denoising – time bars
Accounting for order fragmentation – volume bars
Accounting for price changes – dollar bars
AlgoSeek minute bars – equity quote and trade data
From the consolidated feed to minute bars
Quote and trade data fields
How to process AlgoSeek intraday data
API access to market data
Remote data access using pandas
Reading HTML tables
pandas-datareader for market data
yfinance – scraping data from Yahoo! Finance
How to download end-of-day and intraday prices
How to download the option chain and prices
Quantopian
Zipline
Quandl
Other market data providers
How to work with fundamental data
Financial statement data
Automated processing – XBRL
Building a fundamental data time series
Other fundamental data sources
pandas-datareader – macro and industry data
Efficient data storage with pandas
Summary
3. Alternative Data for Finance – Categories and Use Cases
The alternative data revolution
Sources of alternative data
Individuals
Business processes
Sensors
Satellites
Geolocation data
Criteria for evaluating alternative data
Quality of the signal content
Asset classes
Investment style
Risk premiums
Alpha content and quality
Quality of the data
Legal and reputational risks
Exclusivity
Time horizon
Frequency
Reliability
Technical aspects
Latency
Format
The market for alternative data
Data providers and use cases
Social sentiment data
Satellite data
Geolocation data
Email receipt data
Working with alternative data
Scraping OpenTable data
Parsing data from HTML with Requests and
BeautifulSoup
Introducing Selenium – using browser automation
Building a dataset of restaurant bookings and
ratings
Taking automation one step further with Scrapy
and Splash
Scraping and parsing earnings call transcripts
Summary
4. Financial Feature Engineering – How to Research Alpha Factors
Alpha factors in practice – from data to signals
Building on decades of factor research
Momentum and sentiment – the trend is your friend
Why might momentum and sentiment drive excess
returns?
How to measure momentum and sentiment
Value factors – hunting fundamental bargains
Relative value strategies
Why do value factors help predict returns?
How to capture value effects
Volatility and size anomalies
Why do volatility and size predict returns?
How to measure volatility and size
Quality factors for quantitative investing
Why quality matters
How to measure asset quality
Engineering alpha factors that predict returns
How to engineer factors using pandas and NumPy
Loading, slicing, and reshaping the data
Resampling – from daily to monthly frequency
How to compute returns for multiple historical
periods
Using lagged returns and different holding periods
Computing factor betas
How to add momentum factors
Adding time indicators to capture seasonal effects
How to create lagged return features
How to create forward returns
How to use TA-Lib to create technical alpha factors
Denoising alpha factors with the Kalman filter
How does the Kalman filter work?
How to apply a Kalman filter using pykalman
How to preprocess your noisy signals using wavelets
From signals to trades – Zipline for backtests
How to backtest a single-factor strategy
A single alpha factor from market data
Built-in Quantopian factors
Combining factors from diverse data sources
Separating signal from noise with Alphalens
Creating forward returns and factor quantiles
Predictive performance by factor quantiles
The information coefficient
Factor turnover
Alpha factor resources
Alternative algorithmic trading libraries
Summary
5. Portfolio Optimization and Performance Evaluation
How to measure portfolio performance
Capturing risk-return trade-offs in a single number
The Sharpe ratio
The information ratio
The fundamental law of active management
How to manage portfolio risk and return
The evolution of modern portfolio management
Mean-variance optimization
How it works
Finding the efficient frontier in Python
Challenges and shortcomings
Alternatives to mean-variance optimization
The 1/N portfolio
The minimum-variance portfolio
Global Portfolio Optimization – the Black-Litterman
approach
How to size your bets – the Kelly criterion
Optimal investment – multiple assets
Risk parity
Risk factor investment
Hierarchical risk parity
Trading and managing portfolios with Zipline
Scheduling signal generation and trade execution
Implementing mean-variance portfolio optimization
Measuring backtest performance with pyfolio
Creating the returns and benchmark inputs
Getting pyfolio input from Alphalens
Getting pyfolio input from a Zipline backtest
Walk-forward testing – out-of-sample returns
Summary performance statistics
Drawdown periods and factor exposure
Modeling event risk
Summary
6. The Machine Learning Process
How machine learning from data works
The challenge – matching the algorithm to the task
Supervised learning – teaching by example
Unsupervised learning – uncovering useful patterns
Use cases – from risk management to text
processing
Cluster algorithms – seeking similar observations
Dimensionality reduction – compressing
information
Reinforcement learning – learning by trial and error
The machine learning workflow
Basic walkthrough – k-nearest neighbors
Framing the problem – from goals to metrics
Prediction versus inference
Regression – popular loss functions and error
metrics
Classification – making sense of the confusion
matrix
Collecting and preparing the data
Exploring, extracting, and engineering features
Using information theory to evaluate features
Selecting an ML algorithm
Design and tune the model
The bias-variance trade-off
Underfitting versus overfitting – a visual example
How to manage the bias-variance trade-off
Learning curves
How to select a model using cross-validation
How to implement cross-validation in Python
KFold iterator
Leave-one-out CV
Leave-P-Out CV
ShuffleSplit
Challenges with cross-validation in finance
Time series cross-validation with scikit-learn
Purging, embargoing, and combinatorial CV
Parameter tuning with scikit-learn and Yellowbrick
Validation curves – plotting the impact of
hyperparameters
Learning curves – diagnosing the bias-variance
trade-off
Parameter tuning using GridSearchCV and pipeline
Summary
7. Linear Models – From Risk Factors to Return Forecasts
From inference to prediction
The baseline model – multiple linear regression
How to formulate the model
How to train the model
Ordinary least squares – how to fit a hyperplane to
the data
Maximum likelihood estimation
Gradient descent
The Gauss–Markov theorem
How to conduct statistical inference
How to diagnose and remedy problems
Goodness of fit
Heteroskedasticity
Serial correlation
Multicollinearity
How to run linear regression in practice
OLS with statsmodels
Stochastic gradient descent with sklearn
How to build a linear factor model
From the CAPM to the Fama–French factor models
Obtaining the risk factors
Fama–Macbeth regression
Regularizing linear regression using shrinkage
How to hedge against overfitting
How ridge regression works
How lasso regression works
How to predict returns with linear regression
Preparing model features and forward returns
Creating the investment universe
Selecting and computing alpha factors using TA-
Lib
Adding lagged returns
Generating target forward returns
Dummy encoding of categorical variables
Linear OLS regression using statsmodels
Selecting the relevant universe
Estimating the vanilla OLS regression
Diagnostic statistics
Linear regression using scikit-learn
Selecting features and targets
Cross-validating the model
Evaluating the results – information coefficient and
RMSE
Ridge regression using scikit-learn
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Tuning the regularization parameters using cross-
validation
Cross-validation results and ridge coefficient paths
Top 10 coefficients
Lasso regression using sklearn
Cross-validating the lasso model
Evaluating the results – IC and lasso path
Comparing the quality of the predictive signals
Linear classification
The logistic regression model
The objective function
The logistic function
Maximum likelihood estimation
How to conduct inference with statsmodels
Predicting price movements with logistic regression
How to convert a regression into a classification
problem
Cross-validating the logistic regression
hyperparameters
Evaluating the results using AUC and IC
Summary
8. The ML4T Workflow – From Model to Strategy Backtesting
How to backtest an ML-driven strategy
Backtesting pitfalls and how to avoid them
Getting the data right
Look-ahead bias – use only point-in-time data
Survivorship bias – track your historical universe
Outlier control – do not exclude realistic extremes
Sample period – try to represent relevant future
scenarios
Getting the simulation right
Mark-to-market performance – track risks over
time
Transaction costs – assume a realistic trading
environment
Timing of decisions – properly sequence signals
and trades
Getting the statistics right
The minimum backtest length and the deflated SR
Optimal stopping for backtests
How a backtesting engine works
Vectorized versus event-driven backtesting
Key implementation aspects
Data ingestion – format, frequency, and timing
Factor engineering – built-in factors versus
libraries
ML models, predictions, and signals
Trading rules and execution
Performance evaluation
backtrader – a flexible tool for local backtests
Key concepts of backtrader's Cerebro architecture
Data feeds, lines, and indicators
From data and signals to trades – strategy
Commissions instead of commission schemes
Making it all happen – Cerebro
How to use backtrader in practice
How to load price and other data
How to formulate the trading logic
How to configure the Cerebro instance
backtrader summary and next steps
Zipline – scalable backtesting by Quantopian
Calendars and the Pipeline for robust simulations
Bundles – point-in-time data with on-the-fly
adjustments
The Algorithm API – backtests on a schedule
Known issues
Ingesting your own bundles with minute data
Getting your data ready to be bundled
Writing your custom bundle ingest function
Registering your bundle
Creating and registering a custom TradingCalendar
The Pipeline API – backtesting an ML signal
Enabling the DataFrameLoader for our Pipeline
Creating a pipeline with a custom ML factor
How to train a model during the backtest
Preparing the features – how to define pipeline
factors
How to design a custom ML factor
Tracking model performance during a backtest
Instead of how to use
Summary
9. Time-Series Models for Volatility Forecasts and Statistical
Arbitrage
Tools for diagnostics and feature extraction
How to decompose time-series patterns
Rolling window statistics and moving averages
How to measure autocorrelation
How to diagnose and achieve stationarity
Transforming a time series to achieve stationarity
Handling instead of how to handle
On unit roots and random walks
How to diagnose a unit root
How to remove unit roots and work with the
resulting series
Time-series transformations in practice
Univariate time-series models
How to build autoregressive models
How to identify the number of lags
How to diagnose model fit
How to build moving-average models
How to identify the number of lags
The relationship between the AR and MA models
How to build ARIMA models and extensions
How to model differenced series
How to identify the number of AR and MA terms
Adding features – ARMAX
Adding seasonal differencing – SARIMAX
How to forecast macro fundamentals
How to use time-series models to forecast volatility
The ARCH model
Generalizing ARCH – the GARCH model
How to build a model that forecasts volatility
Multivariate time-series models
Systems of equations
The vector autoregressive (VAR) model
Using the VAR model for macro forecasts
Cointegration – time series with a shared trend
The Engle-Granger two-step method
The Johansen likelihood-ratio test
Statistical arbitrage with cointegration
How to select and trade comoving asset pairs
Pairs trading in practice
Distance-based heuristics to find cointegrated
pairs
How well do the heuristics predict significant
cointegration?
Preparing the strategy backtest
Precomputing the cointegration tests
Getting entry and exit trades
Backtesting the strategy using backtrader
Tracking pairs with a custom DataClass
Running and evaluating the strategy
Extensions – how to do better
Summary
10. Bayesian ML – Dynamic Sharpe Ratios and Pairs Trading
How Bayesian machine learning works
How to update assumptions from empirical evidence
Exact inference – maximum a posteriori estimation
How to select priors
How to keep inference simple – conjugate priors
Dynamic probability estimates of asset price
moves
Deterministic and stochastic approximate inference
Markov chain MonteCarlo sampling
Variational inference and automatic differentiation
Probabilistic programming with PyMC3
Bayesian machine learning with Theano
The PyMC3 workflow – predicting a recession
The data – leading recession indicators
Model definition – Bayesian logistic regression
Exact MAP inference
Approximate inference – MCMC
Approximate inference – variational Bayes
Model diagnostics
How to generate predictions
Summary and key takeaways
Bayesian ML for trading
Bayesian Sharpe ratio for performance comparison
Defining a custom probability model
Comparing the performance of two return series
Bayesian rolling regression for pairs trading
Stochastic volatility models
Summary
11. Random Forests – A Long-Short Strategy for Japanese Stocks
Decision trees – learning rules from data
How trees learn and apply decision rules
Decision trees in practice
The data – monthly stock returns and features
Building a regression tree with time-series data
Building a classification tree
Visualizing a decision tree
Evaluating decision tree predictions
Overfitting and regularization
How to regularize a decision tree
Decision tree pruning
Hyperparameter tuning
Using GridsearchCV with a custom metric
How to inspect the tree structure
Random documents with unrelated
content Scribd suggests to you:
"Dearest boy," she said, "I can't believe that you will ever forget how
cruel I was to you, though I know that you forgave me long ago."
"The memory of it is buried somewhere in the Pernamba bush, with the
body of Penthouse," he answered, gently.
"But tell me," she began, and paused.
"Anything," he laughed back.
"Did you ever care for Marion Tetson?"
"Not even in those days—when she was really charming."
Several months later, at the house of a mutual friend, Mrs. Travers met
General Davidson. The general beamed upon her with marked cordiality.
"I am glad to know that some English people appreciate a good thing,"
he said.
The rest of the company turned to see what was going on, and the old
lady stared.
"I am speaking of your distinguished son-in-law, Herbert Hemming,"
continued the general, in a dress-parade voice, "and I assure you, madam,
that when he took command of the military district of Rio Janeiro, England
lost a valuable man. It is a crying shame," he added, glaring around, "that
the English government had not Mrs. Travers's discernment."
The dame mumbled a meaningless reply. A curate sniggered behind his
hand. Later Mrs. Travers cornered her hostess.
"Why didn't the ungrateful girl tell me?" she asked.
"Tell you what, my dear?"
"About that Rio Janeiro military district."
"You should have read the papers, my dear," replied her hostess, coldly;
"then, perhaps, you would not have made yourself so ridiculous."
THE END.
GILBERT AND RIVINGTON, LD., ST. JOHN'S HOUSE, CLERKENWELL, E.C.
*** END OF THE PROJECT GUTENBERG EBOOK HEMMING, THE
ADVENTURER ***
Updated editions will replace the previous one—the old editions will
be renamed.
Creating the works from print editions not protected by U.S.
copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.
START: FULL LICENSE
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg™ mission of promoting the free
distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.
Section 1. General Terms of Use and
Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.
1.B. “Project Gutenberg” is a registered trademark. It may only be
used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E. Unless you have removed all references to Project Gutenberg:
1.E.1. The following sentence, with active links to, or other
immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
1.E.2. If an individual Project Gutenberg™ electronic work is derived
from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.
1.E.3. If an individual Project Gutenberg™ electronic work is posted
with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.
1.E.4. Do not unlink or detach or remove the full Project
Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute this
electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
1.E.7. Do not charge a fee for access to, viewing, displaying,
performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.
1.E.8. You may charge a reasonable fee for copies of or providing
access to or distributing Project Gutenberg™ electronic works
provided that:
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You provide a full refund of any money paid by a user who
notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.
• You provide, in accordance with paragraph 1.F.3, a full refund of
any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™
electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend
considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for
the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you
discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
1.F.5. Some states do not allow disclaimers of certain implied
warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,
the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.
Section 2. Information about the Mission
of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.
Volunteers and financial support to provide volunteers with the
assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.
Section 3. Information about the Project
Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.
The Foundation’s business office is located at 809 North 1500 West,
Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.
The Foundation is committed to complying with the laws regulating
charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.
While we cannot and do not solicit contributions from states where
we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.
International donations are gratefully accepted, but we cannot make
any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Section 5. General Information About
Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
This website includes information about Project Gutenberg™,
including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.