You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is the code for downloading historical stock data for a company to a CSV file
from datetime import date from jugaad_data.nse import stock_csv stock_csv(symbol="NATIONALUM", from_date=date(2020,1,1), to_date=date(2023,1,18), series="EQ", _output="D:\\Stock\\NALUM.csv")
NSE Symbol : NATIONALUM
From Date : 1/1/2020
To Date : 1/18/2023
This should've pulled the data for all the 760 trading days in that time range into the CSV file. However the data is missing for the time period 10/6/2021 to 31/5/2022
This isn't a standalone issue for this particular company. All of them have the same issue of missing data for a particular period within the expected time range nationalum.txt NALUM.csv
Example Code
fromdatetimeimportdatefromjugaad_data.nseimportstock_csv# Download data and save to a csv filestock_csv(symbol="NATIONALUM", from_date=date(2020,1,1),
to_date=date(2023,1,18), series="EQ", output="D:\\Stock\\NALUM.csv")
If the above step is ok, then please check if you are getting correct data from nse website for 1/6/2021 to 31/6/2021, 1/7/2021 to 30/7/2021.. randomly for few months
If 2 is ok, check .cache folder in your home directory does it have data for those symbols
On looking at the data on the NSE website, I found that the series changed from EQ to BE on 2021-06-09 and onwards until 2021-11-22.
This can be fixed by changing the interface of NSEHistory._stock to accept a tuple of series, i.e. def _stock(self, symbol, from_date, to_date, series=("EQ",)):, and its usages. See the below snippets. This can be made backwards compatible relatively easily by converting series if it is a string to a tuple of string.
Issue description
Below is the code for downloading historical stock data for a company to a CSV file
from datetime import date from jugaad_data.nse import stock_csv stock_csv(symbol="NATIONALUM", from_date=date(2020,1,1), to_date=date(2023,1,18), series="EQ", _output="D:\\Stock\\NALUM.csv")
NSE Symbol : NATIONALUM
From Date : 1/1/2020
To Date : 1/18/2023
This should've pulled the data for all the 760 trading days in that time range into the CSV file. However the data is missing for the time period 10/6/2021 to 31/5/2022
This isn't a standalone issue for this particular company. All of them have the same issue of missing data for a particular period within the expected time range
nationalum.txt
NALUM.csv
Example Code
Error snippet
The text was updated successfully, but these errors were encountered: