Skip to main content
~/Anil Goral
All work~/work/projects/cnn-volume-trading-strategy

Machine Learning Finance · 2025

CNN Volume-Based Trading Strategy

A machine-learning trading research project using technical indicators, CNN modeling, confidence thresholds, and backtesting.

My role
Model experimentation, backtesting, visualization
Status
Research project
~/preview/cnn-volume-trading-strategy
Machine learning trading strategy visualization.
Primary project visualization from the trading strategy research.

01 · The idea

A full ML research loop, not only a model file

The project covers data ingestion, feature engineering, model training, thresholded signal generation, backtesting, and visual evaluation.

02 · How it works

From market data to signal confidence

Daily SPY data is transformed into lookback windows with price, volume, and indicator features. The CNN predicts next-day direction, and confidence thresholds decide when the model is allowed to act.

03 · The hard part

Prevent leakage and overfitting from dominating the story

Financial ML work can look convincing while being fragile. The important engineering constraints are clean train/test separation, robust preprocessing, transaction assumptions, and honest comparison against buy-and-hold.

04 · What's next

Risk management and richer validation

Future work should include stop-loss logic, dynamic thresholds, broader assets, walk-forward validation, and sharper treatment of transaction costs.

~/outcomes

Results

  • Built a complete data preprocessing, modeling, and backtesting loop.
  • Expanded from volume-only features to broader technical indicators.
  • Added signal thresholds to control confidence and reduce noisy trades.

~/stack

Built with

  • Python
  • Pandas
  • Scikit-learn
  • PyTorch
  • Matplotlib
  • Seaborn

More screenshots

Equity curve from the CNN trading strategy.
Backtested equity curve.
Buy and sell signals from the trading strategy.
Buy and sell signal visualization.