book-logo
chapters-icon

Chapter 6: Applied Machine Learning

In-depth summaries and key insights.

Part III
Advanced Applications of AI in Trading and Risk Management

Example 1: ML Trend Scanning with MLFinlab

Uses MLFinLab's trend scanning package to detect price trends (up/down/no-trend) for timing Bitcoin trades.

Example 2: Factor Preprocessing Techniques for Regime Detection

Applies different preprocessing techniques and PCA on market factors to predict SPY's weekly returns using a multiclass random forest model.

Example 3: Reversion vs. Trending: Strategy Selection by Classification

Uses neural networks to predict whether the next trading day will favor momentum or reversion risk exposure by analyzing volatility indicators.

Example 4: Alpha by Hidden Markov Models

Employs Hidden Markov Models to predict market volatility regimes and allocate funds between different ETFs and options accordingly.

Example 5: Effect of Positive-Negative Splits

Utilizes a multiple linear regression model to estimate future returns when stock splits are imminent and trades accordingly.

Example 6: Dividend Harvesting Selection of High-Yield Assets

Uses a decision tree regression model to predict future dividend yields based on financial ratios to build a high-yield portfolio.

Example 7: PCA Statistical Arbitrage Mean Reversion

Applies PCA and linear regression for statistical arbitrage to exploit price differences between related securities.

Example 8: Stop Loss Based on Historical Volatility and Drawdown Recovery

Uses regression models to dynamically adjust stop-loss levels based on market conditions.

Example 9: Head Shoulders Pattern Matching with CNN

Employs a one-dimensional CNN to detect head-and-shoulders trading patterns in forex markets.

Example 10: Stock Selection through Clustering Fundamental Data

Uses PCA and learning-to-rank algorithms to predict relative performance of stocks based on fundamental data.

Example 11: Inverse Volatility Rank and Allocate to Future Contracts

Applies ridge regression to predict volatility and allocate futures contracts inversely proportional to their expected volatility.

Example 12: Trading Costs Optimization

Uses a DecisionTreeRegressor to predict trading costs and optimize trade execution timing.

Example 13: PCA Statistical Arbitrage

Implements PCA and linear regression for statistical arbitrage to identify trading opportunities in related securities.

Example 14: Temporal CNN Prediction

Uses a temporal CNN to predict the direction of future stock prices based on OHLCV data.

Example 15: Gaussian Classifier for Direction Prediction

Employs Gaussian Naive Bayes classifiers to predict daily returns of technology stocks.

Example 16: LLM Summarization of Tiingo News Articles

Uses OpenAI's GPT-4 to analyze sentiment from news articles for trading decisions.

Example 17: Head Shoulders Pattern Matching with CNN

Uses a one-dimensional CNN to detect head-and-shoulders patterns and trade forex accordingly.

Example 18: Amazon Chronos Model

Utilizes Amazon's Chronos model to forecast future price paths and optimize portfolio weights.

Example 19: FinBERT Model

Applies the FinBERT language model to assess news sentiment and make trading decisions based on aggregate sentiment scores.