r/pinescript • • 1d ago

Integrate options chain data

As a futures trader I would love to see the options chain data available in pinescript so I can model GEX levels and show the open interest ladder. Is this something that's on the roadmap?

2 Upvotes

6 comments sorted by

1

u/halcyonwit 1d ago

Too optimistic/ambitious for the pinescript. Better off looking elsewhere or even putting something together yourself with ai assisted coding..

1

u/mikemolove 1d ago

Trading view already has options chain data, it would just be a matter of exposing it via pinescript. Not sure why you think this is too optimistic or ambitious.

1

u/halcyonwit 1d ago

In my experience pine always falls short, for much lesser tasks even.

1

u/JDT-HOLDINGS 1d ago

No idea on the roadmap. That's one for TradingView directly, so it's worth posting on their feature request page.
In the meantime, Pine can request individual option tickers with request.security() where TradingView has them, and there's a public library called OptionChain that does this. It only gives last price and volume per strike though, not open interest, so a proper GEX model isn't really doable natively. You're also capped at 40 requests per script.
Simplest workaround for futures: calculate GEX elsewhere and paste the levels in as an input, then plot them as lines.

1

u/AcanthocephalaNo6605 1d ago

not that i've heard, and i wouldn't hold my breath. what i do is work out the levels outside (cboe delayed data or a broker api), then paste the strikes into an input string and parse it with str.split. clunky but you get your gex lines on the chart, i just update it once before the open.