Skip to content

Commit

Permalink
fix: Fix TradeUpdate model for validation error (#372)
Browse files Browse the repository at this point in the history
* fix: fix TradeUpdate model for validation error

* chore: fix lint
  • Loading branch information
hiohiohio authored Oct 27, 2023
1 parent 7a23c04 commit e7a944e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions alpaca/trading/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,16 @@ class CorporateActionAnnouncement(ModelWithID):


class TradeUpdate(BaseModel):
"""
Represents a trade update.
ref. https://docs.alpaca.markets/docs/websocket-streaming#example
"""

event: Union[TradeEvent, str]
execution_id: Optional[UUID]
execution_id: Optional[UUID] = None
order: Order
timestamp: datetime
position_qty: Optional[float]
price: Optional[float]
qty: Optional[float]
position_qty: Optional[float] = None
price: Optional[float] = None
qty: Optional[float] = None

0 comments on commit e7a944e

Please sign in to comment.