fix: round limit_price to 2 decimal places before order submit

Alpaca rejects prices with more than 2 decimal places (code 42210000).
Affected BAC on first live tick.
This commit is contained in:
2026-04-16 22:11:05 +02:00
parent 39875112a0
commit c44e3324c6
+1 -1
View File
@@ -55,7 +55,7 @@ def _build_request(intent: OrderIntent) -> Any:
**common, **common,
) )
if intent.order_type == "limit": if intent.order_type == "limit":
return LimitOrderRequest(limit_price=intent.limit_price, **common) return LimitOrderRequest(limit_price=round(intent.limit_price, 2), **common)
return MarketOrderRequest(**common) return MarketOrderRequest(**common)