Skip to content

Commit

Permalink
fix: sert position_intent optional (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiohiohio authored Dec 20, 2024
1 parent da833d3 commit 8369d65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions alpaca/trading/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Order(ModelWithID):
trail_percent (Optional[str]): The percent value away from the high water mark for trailing stop orders.
trail_price (Optional[str]): The dollar value away from the high water mark for trailing stop orders.
hwm (Optional[str]): The highest (lowest) market price seen since the trailing stop order was submitted.
position_intent (PositionIntent): Represents the desired position strategy.
position_intent (Optional[PositionIntent]): Represents the desired position strategy.
"""

client_order_id: str
Expand Down Expand Up @@ -239,7 +239,7 @@ class Order(ModelWithID):
trail_percent: Optional[str] = None
trail_price: Optional[str] = None
hwm: Optional[str] = None
position_intent: PositionIntent
position_intent: Optional[PositionIntent] = None

def __init__(self, **data: Any) -> None:
if "order_class" not in data or data["order_class"] == "":
Expand Down
3 changes: 1 addition & 2 deletions tests/trading/trading_client/test_order_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ def test_get_orders(reqmock, trading_client: TradingClient):
"extended_hours": true,
"trail_percent": null,
"trail_price": null,
"hwm": "string",
"position_intent": "buy_to_open"
"hwm": "string"
}
]
""",
Expand Down

0 comments on commit 8369d65

Please sign in to comment.