【发布时间】:2021-09-27 15:28:16
【问题描述】:
我正在尝试将字典 opt_chain 作为参数传递
opt_chain = {
'symbol': 'AAPL',
'contractType': 'CALL',
'optionType': 'S',
'fromDate': '2021-07-18',
'afterDate': '2021-07-19',
'strikeCount': 4,
'includeQuotes': True,
'range': 'ITM',
'strategy': 'ANALYTICAL',
'volatility': 29.0
}
到函数apiget_options_chain
但我收到以下错误
option_chains = td_client.get_options_chain(args_dictionary = opt_chain)
TypeError: get_options_chain() got an unexpected keyword argument 'args_dictionary'
这是我运行的代码(摘录):
opt_chain = {
'symbol': 'AAPL',
'contractType': 'CALL',
'optionType': 'S',
'fromDate': '2021-07-18',
'afterDate': '2021-07-19',
'strikeCount': 4,
'includeQuotes': True,
'range': 'ITM',
'strategy': 'ANALYTICAL',
'volatility': 29.0
}
option_chains = td_client.get_options_chain(args_dictionary = opt_chain)
pprint.pprint(option_chains)
这是 Python v3.6.9
非常感谢任何帮助,
谢谢
【问题讨论】:
标签: python-3.x dictionary arguments