core.py
PastDays
Source code in pystocktopus/core.py
CalculateDate(start_date_str, days_lag)
staticmethod
Calculates the start date for the data collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_date_str
|
str
|
The end date for the data collection. |
required |
days_lag
|
int
|
The number of days to subtract from the end date to get the start date. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
The start date for the data collection in the format "YYYY-MM-DD". |
Source code in pystocktopus/core.py
StockExtractor
Extracts stock data from Polygon.io.
Source code in pystocktopus/core.py
ticker_data_collection(ticker_values, timespan, multiplier, user_date, days)
Extracts stock data closing price from Polygon.io.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ticker_values
|
List[str]
|
A list of stock ticker symbols. |
required |
timespan
|
str
|
The time span of the data to collect. Valid values are "day", "week", "month", and "quarter". |
required |
multiplier
|
int
|
The multiplier to apply to the time span. For example, a multiplier of 2 will collect data for twice the specified time span. |
required |
user_date
|
str
|
The date up to which to collect data. |
required |
days
|
int
|
The number of days to retrieve data for. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
List[float]: A list of closing prices for the specified stocks. |