NSEPY get_history() function not working for currencies

1k Views Asked by At

Why is my data frame empty? If I execute the get_history() function for stocks like SBIN, the code works. But it doesn't work for currency derivatives like USDINR.

pip install nsepy

from nsepy import get_history
from datetime import date
import matplotlib

usdinr = get_history(symbol="USDINR", start=date(2019,6,1), 
                 end=date(2019,6,10), option_type="CE",
                 strike_price=69.25,expiry_date=date(2019,6,21))
print(usdinr)

enter image description here

1

There are 1 best solutions below

0
Rajendra Barawakar On BEST ANSWER

Show Code:

from nsepy import get_history
from history import *
from datetime import date
import datetime as dt
import sys
datas="ti"
end_day = date.today()    
start_day = end_day - timedelta(90)
print(datas, start_day, end_day)
print(stock) 

Output is :

=============== RESTART: D:\Web_Python\History_Data - Dummy.py =============== ('ti', datetime.date(2019, 9, 19), datetime.date(2019, 12, 18))

did not return data

I want this code for my website https://barawakar.com/