Skip to content
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

[FeatureReuest]: GetOptionContractsRequest.strike_price_lte returning data in ascending order #470

Open
1 task done
johnamcruz opened this issue Jun 11, 2024 · 1 comment

Comments

@johnamcruz
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I use GetOptionContractsRequest.strike_price_lte the data is returned in ascending order. it's returning the option prices for the very last item instead of the first item that is closer to the strike price similar how the data is returned for strike_price_gte

Expected Behavior

When I use GetOptionContractsRequest.strike_price_lte the data is returned it should return the first item that is closer to the strike price.

SDK Version I encountered this issue in

latest version

Steps To Reproduce

call the request below 


req = GetOptionContractsRequest(
    underlying_symbols = [ "QQQ" ],                     # specify underlying symbols
    status = AssetStatus.ACTIVE,                                 # specify asset status: active (default)
    expiration_date = datetime.today.date()                                      
    type = "put",                                                # specify option type: put
    style = ExerciseStyle.AMERICAN,                              # specify option style: american
    strike_price_lte = "60.0",                                     # specify strike price range
    limit = 100,                                                 # specify limit
    page_token = None,                                           # specify page
)

res = trade_client.get_option_contracts(req)


### Filled out the Steps to Reproduce section?

- [X] I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.

### Anything else?

_No response_
@hiohiohio hiohiohio changed the title [Bug]: GetOptionContractsRequest.strike_price_lte returning data in ascending order [FeatureReuest]: GetOptionContractsRequest.strike_price_lte returning data in ascending order Jun 12, 2024
@hiohiohio
Copy link
Contributor

@johnamcruz Thank you for this report.
I have changed this to FeatureRequest as currently we do not have this feature of changing order of response.
I passed this feature request to the related people.

Current workaround is fetching all the data using page tokens and sort the responses by yourself unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants