【发布时间】:2011-06-22 15:46:51
【问题描述】:
我正在使用 YQL 检索金融期权数据。比如:
select * from yahoo.finance.options where symbol="AAPL" and expiration="2011-07"
但是,上述查询返回optionsChain 的数据。
有没有办法只检索特定选项符号的记录,例如symbol=AAPL110716C00155000?
感谢您的宝贵时间。
【问题讨论】:
我正在使用 YQL 检索金融期权数据。比如:
select * from yahoo.finance.options where symbol="AAPL" and expiration="2011-07"
但是,上述查询返回optionsChain 的数据。
有没有办法只检索特定选项符号的记录,例如symbol=AAPL110716C00155000?
感谢您的宝贵时间。
【问题讨论】:
除了“远程过滤器”(symbol 和expiration)之外,您还可以对从yahoo.finance.options 返回的结果集应用“本地过滤器”,以获得所需的符号。
select option
from yahoo.finance.options
where symbol = "AAPL"
and expiration = "2011-07"
and option.symbol = "AAPL110716C00155000"
有关过滤查询结果的更多信息,请参阅 YQL 文档中的 Filtering Query Results (WHERE) 页面。
【讨论】:
我刚刚得到了所有 optionsChain 的数据:
select * from yahoo.finance.options where symbol="A" and expiration="2012-10"
然后,只需使用 JSON Parser 来解析 optionsChain 的数据并得到我想要的数据。
【讨论】: