-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open Interest Support #12
Comments
SpecificationIs there the means to query for open interest value when using Polygon datasets ?Current
ProposedThe below files should be modified to support the, above noted, current specification
|
Can you and or your support team please assist with getting my PR reviewed and approved. ref: #15 Many thanks |
FYI, the following algorithm reproduces the bug: # region imports
from AlgorithmImports import *
# endregion
class IndexOptionAlgorithm(QCAlgorithm):
def initialize(self):
self.set_start_date(2024, 1, 1)
self.set_end_date(2024, 5, 1)
self.set_cash(100000)
self.spx = self.add_index('SPX')
self.spx_option = self.add_index_option(self.spx.symbol)
self.spx_option.set_filter(-1, 1, 0, 100)
def on_data(self, data: Slice):
if self.algorithm_mode is not AlgorithmMode.LIVE:
return
chain = data.option_chains.get(self.spx_option.symbol)
if not chain:
return
for contract in chain:
self.log(f"{contract.symbol}| open interest: {contract.open_interest}; delta: {contract.greeks.delta}; implied volatility: {contract.implied_volatility}.") Excerpt from logs when using QC + Polygon as data providers in live mode:
|
Expected Behavior
This data source supports open interest.
Actual Behavior
We receive the following message:
Proposed Solution
It's found in the Option Chain endpoint
/v3/snapshot/options/{underlyingAsset}
https://polygon.io/docs/options/get_v3_snapshot_options__underlyingasset
Reproducing the Problem
Deploy index option algorithm with polygon data provider.
Checklist
master
branchThe text was updated successfully, but these errors were encountered: