book-logo
examples-icon

Examples

20+ practical examples of AI in trading on QuantConnect.

ML Trend Scanning with MLFinlab

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

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.

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.

Alpha by Hidden Markov Models

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

FX SVM Wavelet Forecasting

Uses Support Vector Machines (SVM) and wavelets to predict forex pair prices, where wavelets decompose price data into components and SVM predicts each component separately.

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.

Effect of Positive-Negative Splits

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

Stop Loss Based on Historical Volatility and Drawdown Recovery

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

ML Trading Pairs Selection

Demonstrates using PCA and clustering techniques to identify potential pairs for statistical arbitrage trading. It first applies PCA to transform standardized stock returns into principal components, then uses the OPTICS clustering algorithm and various statistical tests (cointegration, Hurst exponent, half-life) to select optimal trading pairs.

Stock Selection through Clustering Fundamental Data

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

Inverse Volatility Rank and Allocate to Future Contracts

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

Trading Costs Optimization

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

PCA Statistical Arbitrage Mean Reversion

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

Temporal CNN Prediction

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

Gaussian Classifier for Direction Prediction

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

LLM Summarization of Tingo News Articles

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

Head Shoulders Pattern Matching with CNN

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

Amazon Chronos Model

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

FinBERT Model

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

GET THE BOOK

Hands-On AI Trading

With Python, QuantConnect and AWS

$55

  • Modern, Hands-on Approach to AI in Trading.
  • A Comprehensive Suite of Examples.
  • Practically Introduces Quantitative Concepts.
  • Rich Additional Content and Community.