alpacahq / alpacahq/alpaca-py

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

Đang mở
#470 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
1.5k
Fork
398
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
6

Mô tả

### Is there an existing issue for this?

- [X] 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

```markdown
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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.