Option data on an instrument (Put-Call Ratio)

Drago112

Member
Joined
Mar 22, 2020
Posts
11
Likes
1
I want to get the put-call ratio on a given underlying instrument. This involves finding the open interest (which seems do-able from the API docs) for all the put and call strikes for a given expiration date. For example, for SPY options expiring on 4/9/2020 (late next week), there are probably 50 strike prices. I need to get open interest for both puts and calls for each of those prices. This is multiple instruments on steroids.

I clearly can't have the user try to enter all the individual option contracts to look at in the setup dialog. Is there a way to find all the potential options at run-time?
 
Top