A Python-based tool that visualizes security price forecasts, optimizes portfolios for maximum Sharpe ratio, and integrates sentiment analysis to generate trading signals.
This project combines multiple financial modeling techniques:
- Geometric Brownian Motion and Monte Carlo simulations to forecast security prices.
- Portfolio Optimization aimed at maximizing the Sharpe ratio for specified target returns.
- Bollinger Bands over projected price paths to identify potential trade entries and exits.
- Sentiment Analysis on textual data (including Elon Musk’s tweets) to derive buy, sell, or hold signals.
The result is a dynamic portfolio visualizer that can help investors, data scientists, and quants better understand and manage their investments.
-
Algorithm for Security Price Forecasting
- Utilizes Geometric Brownian Motion and Monte Carlo simulations for more accurate short- to medium-term price predictions.
-
Asset Allocation & Sharpe Ratio Optimization
- Implements a model to optimize asset weights while respecting user-defined return targets.
-
Bollinger Bands Application
- Overlays Bollinger Bands on projected security price paths, providing crucial insights for trade timing.
-
Sentiment Analysis Model
- Scrapes web data (e.g., news, social media) to produce a quantitative sentiment score, which translates into buy, sell, or hold signals.
-
Elon Musk’s Tweets Analysis
- Conducts sentiment analysis on Elon Musk’s historical tweets, potentially detecting influences on specific stock movements.
Below is an overview of the key files included. Click any of the links to view detailed information:
- understand.py – Additional project background and context.
- tp3final(112).py – Main script or notes explaining the core functionalities.
- bands_gbm.py – Detailed explanation and usage of Bollinger Bands with Geometric Brownian Motion.
- sentimentanalysis.py – Outline of the sentiment analysis pipeline.
- optimise.py – Sharpe ratio optimization and portfolio allocation methodologies.
- elon.py – Details on the Elon Musk tweets dataset and its analysis.
- brownianmotion.py – Mathematical background on Geometric Brownian Motion.
- simulate.py – Explanation of the Monte Carlo simulation process.
- cmu_112_graphics.py – Visualization and UI notes (if relevant).
- TweetsElonMusk.csv – Dataset containing Elon Musk's tweets for sentiment analysis.
Feel free to customize any directories and filenames according to your local project structure.
- Clone this repository:
git clone https://github.com/yourusername/yourrepository.git cd yourrepository

