hootnot / oanda-api-v20

OANDA REST-V20 API wrapper. Easy access to OANDA's REST v20 API with oandapyV20 package. Checkout the Jupyter notebooks!
MIT License
402 stars 107 forks source link

instruments.InstrumentsOrderBook fails for some instruments #132

Closed illi4 closed 6 years ago

illi4 commented 6 years ago

When I try to call instruments.InstrumentsOrderBook, it does not work for many instruments(for example 'NAS100_USD' or 'SPX500_USD'). The error message is "NAS100_USD is not a valid instrument". All the other endpoints work fine. The code snippet I am using is:

request = instruments.InstrumentsOrderBook(instrument = "NAS100_USD") 
orderbook = client.request(request)

How could this be fixed? Just in case, I tried calling instruments.InstrumentsOrderBook with instrument by name (instrument = "US Nas 100"), but this of course does not work as well.

hootnot commented 6 years ago

Hi @illi4, I have a strong feeling this endpoint only accepts currency pairs. Pls drop the question at OANDA.

hootnot commented 6 years ago

@illi4 Hi, I'll close this issue. If you asked the question at OANDA and they gave you an answer pls. write it here also. It might be helpful for others.

illi4 commented 6 years ago

Indeed OANDA responded that orderbook is not enabled for some instruments including stock indices