Skip to content

muratali016/S-P-500-Key-Level-Behavior-ML-Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPY Key Level Price Behavior & ML Predictor

An automated quantitative trading system designed to backtest, analyze, and predict intraday price behavior of the SPDR S&P 500 ETF Trust (SPY) around key technical levels.

This project extracts historical tick data, engineers structural market features (PM/AH levels, ORB, Previous Day levels), and trains an ensemble machine learning model to classify whether a touch of a key level will result in a Rejection (bounce), a Breakout, or remain Unclear.

Features

  • Automated Data Pipeline: Fetches 1m and 5m interval data using yfinance to reconstruct daily sessions and key market levels.
  • Event Extractor: Identifies exact timestamps where price interacts with key levels and calculates the subsequent forward-path trajectory.
  • Feature Engineering: Generates time-based, volume-based (RVOL), and price-momentum features for ML processing.
  • Machine Learning Classifier: Evaluates Random Forest, XGBoost, and Gradient Boosting to classify level interactions.
  • Live Market Scanner: Monitors recent intraday data to provide real-time probability signals for upcoming level touches.

Visualizations

Price Behavior Spaghetti Charts

Visualizes the historical trajectory of SPY after interacting with specific levels (e.g., pre-market highs, opening range breakouts).

image

Model Evaluation

Performance metrics across our tested ensemble models, including 5-Fold Cross-Validation accuracy and the Random Forest confusion matrix.

download

Installation

  1. Clone the repository:
    git clone [https://github.com/YourUsername/spy-key-level-behavior.git](https://github.com/YourUsername/spy-key-level-behavior.git)
    cd spy-key-level-behavior

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages