Skip to content

Commit

Permalink
fix: Fix position_intent for mleg order (#557)
Browse files Browse the repository at this point in the history
* fix: fix position_intent for mleg order

* fix: fix lint
  • Loading branch information
hiohiohio authored Feb 4, 2025
1 parent e2466ba commit 644c5de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion alpaca/trading/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,15 @@ def __init__(self, **data: Any) -> None:

# mleg responses will give ''s that will need to be converted to None
# to avoid validation errors from pydantic
for k in ["asset_id", "symbol", "asset_class", "side", "type", "order_type"]:
for k in [
"asset_id",
"symbol",
"asset_class",
"side",
"position_intent",
"type",
"order_type",
]:
if k in data and data[k] == "":
data[k] = None

Expand Down

0 comments on commit 644c5de

Please sign in to comment.