0%

Book Description

Many industries have been revolutionized by the widespread adoption of AI and machine learning. The programmatic availability of historical and real-time financial data in combination with techniques from AI and machine learning will also change the financial industry in a fundamental way. This practical book explains how to use AI and machine learning to discover statistical inefficiencies in financial markets and exploit them through algorithmic trading.

Author Yves Hilpisch shows practitioners, students, and academics in both finance and data science how machine and deep learning algorithms can be applied to finance. Thanks to lots of self-contained Python examples, you’ll be able to replicate all results and figures presented in the book.

  • Examine how data is reshaping finance from a theory-driven to a data-driven discipline
  • Understand the major possibilities, consequences, and resulting requirements of AI-first finance
  • Get up to speed on the tools, skills, and major use cases to apply AI in finance yourself
  • Apply neural networks and reinforcement learning to discover statistical inefficiencies in financial markets
  • Delve into the concepts of the technological singularity and the financial singularity

Table of Contents

  1. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. O’Reilly Online Learning
    4. How to Contact Us
    5. Acknowledgments
  2. I. Machine Intelligence
  3. 1. Artificial Intelligence
    1. Algorithms
      1. Types of Data
      2. Types of Learning
      3. Types of Problems
      4. Types of Approaches
    2. Neural Networks
      1. OLS Regression
      2. Estimation with Neural Networks
      3. Classification with Neural Networks
    3. Importance of Data
      1. Small Data Set
      2. Larger Data Set
      3. Big Data
    4. Conclusions
    5. Further Resources
  4. 2. Superintelligence
    1. Success Stories
      1. Atari
      2. Go
      3. Chess
    2. Importance of Hardware
    3. Forms of Intelligence
    4. Paths to Superintelligence
      1. Networks and Organizations
      2. Biological Enhancements
      3. Brain-Machine Hybrids
      4. Whole Brain Emulation
      5. Artificial Intelligence
    5. Intelligence Explosion
    6. Goals and Control
      1. Superintelligence and Goals
      2. Superintelligence and Control
    7. Potential Outcomes
    8. Conclusions
    9. Further Resources
  5. II. Finance and Machine Learning
  6. 3. Normative Finance
    1. Uncertainty and Risk
      1. Definitions
      2. Numerical Example
    2. Expected Utility Theory
      1. Assumptions and Results
      2. Numerical Example
    3. Mean-Variance Portfolio Theory
      1. Assumptions and Results
      2. Numerical Example
    4. Capital Asset Pricing Model
      1. Assumptions and Results
      2. Numerical Example
    5. Arbitrage Pricing Theory
      1. Assumptions and Results
      2. Numerical Example
    6. Conclusions
    7. Further Resources
  7. 4. Data-Driven Finance
    1. Scientific Method
    2. Financial Econometrics and Regression
    3. Data Availability
      1. Programmatic APIs
      2. Structured Historical Data
      3. Structured Streaming Data
      4. Unstructured Historical Data
      5. Unstructured Streaming Data
      6. Alternative Data
    4. Normative Theories Revisited
      1. Expected Utility and Reality
      2. Mean-Variance Portfolio Theory
      3. Capital Asset Pricing Model
      4. Arbitrage Pricing Theory
    5. Debunking Central Assumptions
      1. Normally Distributed Returns
      2. Linear Relationships
    6. Conclusions
    7. Further Resources
    8. Python Script
  8. 5. Machine Learning
    1. Learning
    2. Data
    3. Success
    4. Capacity
    5. Evaluation
    6. Bias and Variance
    7. Cross-Validation
    8. Conclusions
    9. Further Resources
  9. 6. AI-First Finance
    1. Efficient Markets
    2. Market Prediction Based on Returns Data
    3. Market Prediction with More Features
    4. Market Prediction Intraday
    5. Conclusions
    6. Further Resources
  10. III. Statistical Inefficiencies
  11. 7. Dense Neural Networks
    1. The Data
    2. Baseline Prediction
    3. Normalization
    4. Dropout
    5. Regularization
    6. Bagging
    7. Optimizers
    8. Conclusions
    9. Further Resources
  12. 8. Recurrent Neural Networks
    1. First Example
    2. Second Example
    3. Financial Price Series
    4. Financial Return Series
    5. Financial Features
      1. Estimation
      2. Classification
      3. Deep RNNs
    6. Conclusions
    7. Further Resources
  13. 9. Reinforcement Learning
    1. Fundamental Notions
    2. OpenAI Gym
    3. Monte Carlo Agent
    4. Neural Network Agent
    5. DQL Agent
    6. Simple Finance Gym
    7. Better Finance Gym
    8. FQL Agent
    9. Conclusions
    10. Further Resources
  14. IV. Algorithmic Trading
  15. 10. Vectorized Backtesting
    1. Backtesting an SMA-Based Strategy
    2. Backtesting a Daily DNN-Based Strategy
    3. Backtesting an Intraday DNN-Based Strategy
    4. Conclusions
    5. References
  16. 11. Risk Management
    1. Trading Bot
    2. Vectorized Backtesting
    3. Event-Based Backtesting
    4. Assessing Risk
    5. Backtesting Risk Measures
      1. Stop Loss
      2. Trailing Stop Loss
      3. Take Profit
    6. Conclusions
    7. References
    8. Python Code
      1. Finance Environment
      2. Trading Bot
      3. Backtesting Base Class
      4. Backtesting Class
  17. 12. Execution and Deployment
    1. Oanda Account
    2. Data Retrieval
    3. Order Execution
    4. Trading Bot
    5. Deployment
    6. Conclusions
    7. Further Resources
    8. Python Code
      1. Oanda Environment
      2. Vectorized Backtesting
      3. Oanda Trading Bot
  18. V. Outlook
  19. 13. AI-Based Competition
    1. AI and Finance
    2. Lack of Standardization
    3. Education and Training
    4. Fight for Resources
    5. Market Impact
    6. Competitive Scenarios
    7. Risks, Regulation, and Oversight
    8. Conclusions
    9. Further Resources
  20. 14. Financial Singularity
    1. Notions and Definitions
    2. What Is at Stake?
    3. Paths to Financial Singularity
    4. Orthogonal Skills and Resources
    5. Scenarios Before and After
    6. Star Trek or Star Wars
    7. Conclusions
    8. Further Resources
  21. VI. Appendices
  22. A. Interactive Neural Networks
    1. Tensors and Tensor Operations
    2. Simple Neural Networks
      1. Estimation
      2. Classification
    3. Shallow Neural Networks
      1. Estimation
      2. Classification
    4. References
  23. B. Neural Network Classes
    1. Activation Functions
    2. Simple Neural Networks
      1. Estimation
      2. Classification
    3. Shallow Neural Networks
      1. Estimation
      2. Classification
    4. Predicting Market Direction
  24. C. Convolutional Neural Networks
    1. Features and Labels Data
    2. Training the Model
    3. Testing the Model
    4. Resources
3.141.30.162