The goal of this project is to predict the next-day direction of the CAC 40 index (Up / Down ) using historical data and engineered technical indicators.
This is a supervised classification problem using tabular time-series data.
Main question:
👉 “Given today's market conditions, can we predict whether tomorrow's CAC 40 closing price will go Up or Down?”
The project follows the complete ML workflow:
- Data acquisition
- Preprocessing & feature engineering
- Model training & tuning
- Evaluation with relevant metrics
- Interpretation of results
Source: Downloaded with yfinance API
Ticker: ^FCHI Interval: Daily Period: Max
Core variables:
- Date
- Open
- High
- Low
- Close
- Volume
Engineered features:
- Daily returns
- Rolling means (5, 10, 20 days)
- Volatility
- RSI
- MACD
- Stochastic Oscillator
- Volume trends
- Date features (month, weekday, etc.)
We generate a 2-class classification label based on the next-day return:
- 1 = Up (return > threshold)
- 0 = Down (return < threshold)
Thresholds were optimized to balance the dataset.
- Checked & forward-filled where needed
- Dropped indicator warm-up rows
- Converted Date to datetime
- Added calendar features (month, day of week…)
The following indicators were computed:
- Rolling returns
- Rolling volatility
- RSI
- MACD + signal line
- Stochastic
- Volume-based features
- Standard scaling where required
- Correlation filtering
- Permutation importance
We tested multiple algorithms:
- Decision Tree
- Random Forest
- KNN
- LightGBM
- Calibrated Classifier
- Final Stacking Classifier
GridSearchCVTimeSeriesSplitfor chronological validationOptunafor best hyperparameters
- F1-binary
- Accuracy
- Confusion Matrix
- Classification Report
This project includes a complete Streamlit dashboard that allows you to:
- Fetch real-time market data from Yahoo Finance
- Rebuild the full feature engineering pipeline
- Predict next-day UP / DOWN direction
- Visualize probabilities and historical charts
- Display live TradingView charts inside the app
- Explore SHAP explainability (global + local)
The app uses the same preprocessing functions and the same LightGBM model as the training notebook, ensuring consistency between offline and live predictions.
Make sure you are in the project root folder, then run:
streamlit run streamlit_app/app.pyGabriel Enthoven
BSc in Data Science for Responsible Business
EM Lyon & Centrale Lyon
This project shows that:
- Technical indicators give predictive signal on market direction
- Stacking improves performance compared to individual models
- Financial time-series remain very noisy and hard to predict
- The pipeline is clean, reproducible, robust, and interpretable
Welcome to the Financial Direction Predictor!
This guide explains how to install the project, reproduce the analysis, and run the interactive prediction app.
Clone the repository:
git clone https://github.com/gabentho/ML-Project-Financial-Predictions.git
cd ML-Project-Financial-PredictionsCreate and activate the conda environment:
conda env create -f environment.yml
conda activate ml-project-financial-predictions- Open the main notebook Cleaned_notebook.ipynb in JupyterLab or any compatible environment
- Inside you will find:
- data cleaning routines
- feature engineering and technical indicators
- model training and tuning
- evaluation of model performance
- result interpretation
⚙️ This option lets you reproduce the full analysis, test your own hypotheses or adapt the pipeline if you like data science.
⸻
For fast and user-friendly predictions, you can launch the web dashboard.
From the project root, run:
streamlit run streamlit_app/app.pyThis will open a web interface in your browser.
In the application, you can:
• Enter any Yahoo Finance ticker (default: ^FCHI)
• Select how many years of historical data to load
• Get a next-day prediction: UP 📈 or DOWN 📉
• View prediction probabilities
• Explore historical charts & technical indicators
• Use SHAP explainability (global + local)
• Inspect the engineered dataset
⸻
• An internet connection is required (Yahoo Finance live data)
• Ensure your conda environment is activated before launching Streamlit
• Predictions are probabilistic — this is an academic project, not financial advice
Everything runs in real time — no manual data preparation needed.
