This project focuses on Time Series Analysis and Forecasting of Tesla (TSLA) stock prices using Facebook Prophet. Before building the forecast model, a comprehensive exploratory data analysis (EDA) was conducted to understand the stock's volatility, trends, and moving averages.
- To analyze the historical trend and seasonality of Tesla stock.
- To understand the risk factor through Volatility Analysis.
- To visualize market sentiment using Moving Averages (MA10 & MA50).
- To predict future stock prices for the next 365 days using the Prophet model.
The dataset contains historical stock data for Tesla, including:
- Date: Trading date
- Open, High, Low, Close: Daily price points
- Volume: Number of shares traded
Used seasonal_decompose to break down the series into:
- Trend: Long-term upward movement observed.
- Seasonality: Recurring patterns.
- Residuals: Random noise.
- Volatility Analysis: Calculated annualized rolling volatility (Window: 252 days) to assess risk.
- Daily Returns: Analyzed daily percentage changes to observe stability.
- Moving Averages: Compared 10-day (Short-term) vs 50-day (Medium-term) moving averages to identify potential "Golden Cross" or "Death Cross" signals.
- The data was prepared in the required
ds(Date) andy(Value) format. - A Prophet model was trained to capture daily seasonality and long-term trends.
- Horizon: Forecast generated for the next 1 year (365 days).
| Metric | Observation |
|---|---|
| Trend | Strong upward trend over the years. |
| Volatility | High volatility periods correlate with major price spikes. |
| Forecast | The model predicts a continuation of the trend with defined confidence intervals. |
- Clone the repository:
git clone [https://github.com/merttdmrr/Tesla-Stock-Forecasting-Prophet.git](https://github.com/merttdmrr/Tesla-Stock-Forecasting-Prophet.git)- Install dependencies:
pip install -r requirements.txt
- Run the notebook:
jupyter notebook notebooks/stock_market_forecasting_prophet.ipynb
Mert Can Demir






