Skip to content

Commit

Permalink
Made it not case sensitive. Fixed print statements. Switched . to , i…
Browse files Browse the repository at this point in the history
…n README.md file.
  • Loading branch information
arnispen committed Jan 26, 2023
1 parent e9ae041 commit b93f1ae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a stock-predictor made with _[SciPy](https://scipy.org)_ and _[YFinance](https://pypi.org/project/yfinance/)_.

***This is my first time trying to create a repository. So please don't judge me too hard!***
***This is my first time trying to create a repository, so please don't judge me too hard!***

------

Expand Down
2 changes: 1 addition & 1 deletion data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

end_date = str(date.today())

print(start_date, end_date)
print("Taken data from:", start_date, "to", end_date)
data = yf.download(stock, start=start_date, end=end_date)

data.to_csv(f"{stock}.csv")
15 changes: 10 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
from scipy import stats
import os

isolated_column = input("What do you want to predict? (Open/High/Low/Close/Adj Close/Volume) ")
isolated_column = input("What do you want to predict? (Open/High/Low/Close/Adj Close/Volume): ")

if isolated_column.lower() == "adj close":
isolated_column = "Adj Close"
else:
isolated_column = isolated_column.capitalize()

x = []
y = []
Expand All @@ -28,15 +33,15 @@
def model(x):
return slope * x + intercept

wanted_prediction = int(input("How far ahead from today do you want to predict? ")) + line_count
wanted_prediction = int(input("How far ahead from today do you want to predict? (in days): ")) + line_count

prediction = model(wanted_prediction)

if today_column < prediction:
print("The prediction is it will be higher (According to the week).")
print("The prediction is it will be higher (according to the week).")
elif today_column > prediction:
print("The prediction is it will be lower (According to the week).")
print("The prediction is it will be lower (according to the week).")
else:
print("The prediction is it will stay the same (According to the week).")
print("The prediction is it will stay the same (according to the week).")

print("And the R is:", r)

0 comments on commit b93f1ae

Please sign in to comment.