Ready for first real test
This commit is contained in:
1 parent
acddf9135f
commit
b91c81ebdf
46 files changed
+34903
-26
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,7 @@
|
||||
|
||||
import numpy as np, pandas as pd, matplotlib.pyplot as plt
|
||||
import yfinance as yf
|
||||
df = yf.download("AAPL", period="3mo", progress=False)
|
||||
close = df["Close"].squeeze() # handle yfinance multiindex
|
||||
print("AAPL last:", round(float(close.iloc[-1]),2), "| 20d SMA:", round(float(close.rolling(20).mean().iloc[-1]),2))
|
||||
close.plot(title="AAPL 3mo"); plt.savefig("aapl.png")
|
||||
Reference in new issue
Block a user