It appears that MarketData doesn't return all options. I was originally trying to figure out why a specific option wasn't showing up when I used MarketData to query for all options contracts returned by a call to GetInstrument, but then I tried limiting the call to MarketData so that I only passed a single OptionInstrument -- calling with a single OptionInstrument doesn't return anything at all.
I made this tweak, and things seem to work now:
Line 241 old:
q := url.Values{"instruments": []string{strings.Join(is[i*num:end], ",")}}
Line 241 new:
q := url.Values{"instruments": []string{strings.Join(is[i*num:end+1], ",")}}
https://github.com/andrewstuart/go-robinhood/blob/59eac0a0310997e1e5c2a2dea67072eab7403be8/options.go#L241
It appears that MarketData doesn't return all options. I was originally trying to figure out why a specific option wasn't showing up when I used MarketData to query for all options contracts returned by a call to GetInstrument, but then I tried limiting the call to MarketData so that I only passed a single OptionInstrument -- calling with a single OptionInstrument doesn't return anything at all.
I made this tweak, and things seem to work now:
Line 241 old: q := url.Values{"instruments": []string{strings.Join(is[i*num:end], ",")}}
Line 241 new: q := url.Values{"instruments": []string{strings.Join(is[i*num:end+1], ",")}}