gpt4 book ai didi

python - NSEPY get_history() 函数不适用于货币

转载 作者:太空宇宙 更新时间:2023-11-03 20:47:04 24 4
gpt4 key购买 nike

为什么我的数据框是空的?如果我对像 SBIN 这样的股票执行 get_history() 函数,代码就会起作用。但它不适用于 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

最佳答案

显示代码:

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)

输出是:

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

没有返回数据

我想要这个代码用于我的网站 https://barawakar.com/

关于python - NSEPY get_history() 函数不适用于货币,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56521686/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com