-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to python 3.13 and implementated code formatting
- Loading branch information
1 parent
5bfeaca
commit e28d019
Showing
17 changed files
with
121 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
numpy==1.24.4 | ||
pandas==2.0.3 | ||
scikit-learn==1.3.2 | ||
yfinance==0.2.36 | ||
matplotlib==3.7.4 | ||
numpy>=1.24.4 | ||
pandas>=2.0.3 | ||
scikit-learn>=1.3.2 | ||
yfinance>=0.2.36 | ||
matplotlib>=3.7.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .predict_future_price import predict_future_price | ||
from .risk_score import risk_score | ||
from .plot_data import plot_data | ||
from .plot_data import plot_data |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,40 @@ | ||
import yfinance as yf | ||
import matplotlib.pyplot as plt | ||
|
||
|
||
def plot_data(ticker_symbol, period) -> bool: | ||
""" | ||
Plots the historical stock data for a given stock based on its ticker symbol and the period in years. | ||
:param ticker_symbol: The stock's ticker symbol as a string. | ||
:param period: The period over which to calculate the risk score ('1mo', '3mo', '6mo', '1y', '2y', etc.). | ||
:return: True if the plot is successful, False otherwise. | ||
""" | ||
# Fetch historical stock data | ||
ticker = yf.Ticker(ticker_symbol) | ||
ticker_data = ticker.history(period=f'{period}y') | ||
ticker_data = ticker.history(period=f"{period}y") | ||
|
||
# Calculate Average | ||
ticker_data['Average'] = (ticker_data['High'] + ticker_data['Low']) / 2 | ||
ticker_data["Average"] = (ticker_data["High"] + ticker_data["Low"]) / 2 | ||
|
||
# Plot the historical stock data | ||
plt.figure(figsize=(14, 7)) | ||
plt.plot(ticker_data.index, ticker_data['Average'], label='Daily Average Price', linewidth=1) | ||
plt.plot( | ||
ticker_data.index, | ||
ticker_data["Average"], | ||
label="Daily Average Price", | ||
linewidth=1, | ||
) | ||
|
||
plt.title(f'Daily Average Price of {ticker.info["longName"]} Stock Over the Last {period} Years') | ||
plt.xlabel('Date') | ||
plt.ylabel('Average Price (USD)') | ||
plt.title( | ||
f'Daily Average Price of {ticker.info["longName"]} Stock Over the Last {period} Years' | ||
) | ||
plt.xlabel("Date") | ||
plt.ylabel("Average Price (USD)") | ||
plt.legend() | ||
plt.grid(True) | ||
plt.tight_layout() | ||
|
||
plt.show() | ||
|
||
return True; | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name='Quant-Market-Predictor', | ||
version='0.1', | ||
name="Quant-Market-Predictor", | ||
version="0.1", | ||
packages=find_packages(), | ||
install_requires=[], | ||
) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters