Skip to content

merttdmrr/Tesla-Stock-Forecasting-Prophet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tesla (TSLA) Stock Price Forecasting with FBProphet 📈⚡

Python Prophet Analysis

📌 Project Overview

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.

🎯 Objectives

  • 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.

📂 Dataset

The dataset contains historical stock data for Tesla, including:

  • Date: Trading date
  • Open, High, Low, Close: Daily price points
  • Volume: Number of shares traded

Data

⚙️ Methodology & Analysis

1. Time Series Decomposition

Used seasonal_decompose to break down the series into:

  • Trend: Long-term upward movement observed.
  • Seasonality: Recurring patterns.
  • Residuals: Random noise.

Decomposition

2. Financial Analysis

  • 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.

Volatility

Return

MA Analysis

3. Forecasting with FBProphet

  • The data was prepared in the required ds (Date) and y (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).

📊 Key Results

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.

Forecast

Forecast Components

💻 How to Run

  1. Clone the repository:
   git clone [https://github.com/merttdmrr/Tesla-Stock-Forecasting-Prophet.git](https://github.com/merttdmrr/Tesla-Stock-Forecasting-Prophet.git)
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the notebook:
jupyter notebook notebooks/stock_market_forecasting_prophet.ipynb

🔗 Author

Mert Can Demir

About

Tesla Stock Market Forecasting with Prophet

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors