StockStalker.past - RockoonTechnologies/StockStalker GitHub Wiki
Past Data
import with:
from StockStalker.past import getPastData
past
contains currently only one function:
getPastData(ticker, startDate, toDate, interval="d"):
dates are in the format: month/day/Year
invervals (the amount of time between each column of data) can be set as:
"d"
- having a interval of a day"w"
- having a inverval of a week"mo"
- having a interval of a month
An example of this function and what it returns a Dataframe:
#get a years worth of data
df = getPastData("AAPL", "2/11/2021", "2/11/2020", interval="d"):
print(df)
,Date,Open,High,Low,Close,Adj Close,Volume
0,2020-02-11,80.900002,80.974998,79.677498,79.902496,79.287888,94323200
1,2020-02-12,80.3675,81.805,80.3675,81.800003,81.170799,113730400
2,2020-02-13,81.047501,81.555,80.837502,81.217499,80.592773,94747600
3,2020-02-14,81.184998,81.495003,80.712502,81.237503,80.612625,80113600