This project is a simple Python script (btc.py
) that fetches historical Bitcoin price data using the yfinance
library and visualizes it using Plotly. It displays a candlestick chart along with a 30-day moving average to analyze the performance of Bitcoin (BTC-USD) over time.
- Fetches Bitcoin (BTC-USD) historical price data from Yahoo Finance.
- Visualizes the data with an interactive candlestick chart using Plotly.
- Plots a 30-day moving average to show price trends.
- yfinance: For retrieving Bitcoin price data from Yahoo Finance.
- Plotly: For creating interactive charts and visualizing the data.
- Datetime: For handling the date range and formatting.
btc.py
: The main script that handles data fetching and visualization.
git clone https://github.com/Lakshya1726/btc-crypto-analysis.git
cd btc-crypto-analysis
You will need to install the necessary Python libraries before running the script:
pip install yfinance plotly
Execute the Python script to fetch the Bitcoin data and generate the candlestick chart:
python btc.py
The script will generate an interactive chart showing:
- Candlestick chart of the Bitcoin price from January 1, 2024, to the current date.
- 30-day moving average plotted over the candlestick chart.
This project is licensed under the MIT License. See the LICENSE file for details.