Pyetrade / Etrade API 仅适用于期权链功能 returns 苹果期权?

Pyetrade / Etrade API for option-chains function only returns options for apple?

我正在尝试使用 pyetrade 包获取一些期权链。我正在为新创建的 Etrade 帐户在沙盒模式下工作。

当我执行以下代码时,它执行得很好,但返回的信息不正确:我在 2012 年和 2015 年之间不断获得 Apple 的选项,而不是当前的 Exxon-Mobil 选项(我输入的内容)。如果我要求 Google 或 Facebook 或 Netflix,也是如此,我只会不断获得过时的 Apple 选项。

我不确定我哪里搞砸了,或者这是否只是沙盒模式的一部分,所以这就是我寻求帮助的原因。谢谢!

(注:部分代码来源于:https://github.com/1rocketdude/pyetrade_option_chains/blob/master/etrade_option_chains.py

以下是从API获取期权链的函数:

def getOption(thisSymbol):
   #Renew session / or start session
   try:
       authManager.renew_access_token()
   except:
       authenticate() #this works fine

   #make a market object to pull what you  need from
   market = pyetrade.ETradeMarket(
       consumer_key,
       consumer_secret,
       tokens['oauth_token'],
       tokens['oauth_token_secret'],
       dev=True
   )

   try:
       #the dates returned are also 
       q = market.get_option_expire_date(thisSymbol,resp_format='xml')
       #just formats the dates to be more comprehensible:
       expiration_dates = option_expire_dates_from_xml(q)
  except Exception:
       raise

   rtn = []
   for this_expiry_date in expiration_dates:
       q = market.get_option_chains(thisSymbol, this_expiry_date)
       chains = q['OptionChainResponse']['OptionPair']
       rtn.append(chains)
   print()
   return rtn

ret = getOption("XOM")
print(ret[0]) 

API 提供者明确说明了这一点:

Note:

E*TRADE's sandbox doesn't actually produce correct option chains so this will return an error.

The sandbox is still useful for debugging e.g. the OAuth stuff.

没有人可以让 sandbox-ed 代码以其他方式工作。