Datasets
Functions
fetch_historical_data
Load historical data for a given symbol
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbol
|
str
|
The symbol to load data for, either 'spx' or 'nifty' |
required |
start_date
|
str
|
The start date to load data for, in 'yyyy-mm-dd' format, by default None |
None
|
end_date
|
str
|
The end date to load data for, in 'yyyy-mm-dd' format, by default None |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
The historical data for the given symbol |
Raises:
Type | Description |
---|---|
ValueError
|
If the symbol is invalid or the start date is greater than the end date
If the start date is less than the first date in the dataset or the end date is greater than the last date in the dataset |