Skip to content

Commit

Permalink
feat: typing for leg parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
aarjaneiro committed Jan 18, 2025
1 parent 6894195 commit cf5f311
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions alpaca/trading/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class OrderRequest(NonEmptyRequest):
extended_hours (Optional[float]): Whether the order can be executed during regular market hours.
client_order_id (Optional[str]): A string to identify which client submitted the order.
order_class (Optional[OrderClass]): The class of the order. Simple orders have no other legs.
legs (Optional[Union[List[OptionLegRequest], List[OrderRequest]]]): For multi-leg option orders, the legs of the order If specified (must contain at least 2 but no more than 4 legs for options).
legs (Optional[List[OptionLegRequest]]): For multi-leg option orders, the legs of the order If specified (must contain at least 2 but no more than 4 legs for options).
Otherwise, for equities, a list of individual orders.
take_profit (Optional[TakeProfitRequest]): For orders with multiple legs, an order to exit a profitable trade.
stop_loss (Optional[StopLossRequest]): For orders with multiple legs, an order to exit a losing trade.
Expand All @@ -312,7 +312,7 @@ class OrderRequest(NonEmptyRequest):
order_class: Optional[OrderClass] = None
extended_hours: Optional[bool] = None
client_order_id: Optional[str] = None
legs: Optional[Union[List[OptionLegRequest], List["OrderRequest"]]] = None
legs: Optional[List[OptionLegRequest]] = None
take_profit: Optional[TakeProfitRequest] = None
stop_loss: Optional[StopLossRequest] = None
position_intent: Optional[PositionIntent] = None
Expand Down Expand Up @@ -372,7 +372,7 @@ class MarketOrderRequest(OrderRequest):
extended_hours (Optional[float]): Whether the order can be executed during regular market hours.
client_order_id (Optional[str]): A string to identify which client submitted the order.
order_class (Optional[OrderClass]): The class of the order. Simple orders have no other legs.
legs (Optional[Union[List[OptionLegRequest], List[OrderRequest]]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
legs (Optional[List[OptionLegRequest]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
take_profit (Optional[TakeProfitRequest]): For orders with multiple legs, an order to exit a profitable trade.
stop_loss (Optional[StopLossRequest]): For orders with multiple legs, an order to exit a losing trade.
position_intent (Optional[PositionIntent]): An enum to indicate the desired position strategy: BTO, BTC, STO, STC.
Expand All @@ -399,7 +399,7 @@ class StopOrderRequest(OrderRequest):
extended_hours (Optional[float]): Whether the order can be executed during regular market hours.
client_order_id (Optional[str]): A string to identify which client submitted the order.
order_class (Optional[OrderClass]): The class of the order. Simple orders have no other legs.
legs (Optional[Union[List[OptionLegRequest], List[OrderRequest]]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
legs (Optional[List[OptionLegRequest]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
take_profit (Optional[TakeProfitRequest]): For orders with multiple legs, an order to exit a profitable trade.
stop_loss (Optional[StopLossRequest]): For orders with multiple legs, an order to exit a losing trade.
stop_price (float): The price at which the stop order is converted to a market order or a stop limit
Expand Down Expand Up @@ -430,7 +430,7 @@ class LimitOrderRequest(OrderRequest):
extended_hours (Optional[float]): Whether the order can be executed during regular market hours.
client_order_id (Optional[str]): A string to identify which client submitted the order.
order_class (Optional[OrderClass]): The class of the order. Simple orders have no other legs.
legs (Optional[Union[List[OptionLegRequest], List[OrderRequest]]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
legs (Optional[List[OptionLegRequest]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
take_profit (Optional[TakeProfitRequest]): For orders with multiple legs, an order to exit a profitable trade.
stop_loss (Optional[StopLossRequest]): For orders with multiple legs, an order to exit a losing trade.
limit_price (Optional[float]): The worst fill price for a limit or stop limit order. For the mleg order class, this
Expand Down Expand Up @@ -472,7 +472,7 @@ class StopLimitOrderRequest(OrderRequest):
extended_hours (Optional[float]): Whether the order can be executed during regular market hours.
client_order_id (Optional[str]): A string to identify which client submitted the order.
order_class (Optional[OrderClass]): The class of the order. Simple orders have no other legs.
legs (Optional[Union[List[OptionLegRequest], List[OrderRequest]]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
legs (Optional[List[OptionLegRequest]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
take_profit (Optional[TakeProfitRequest]): For orders with multiple legs, an order to exit a profitable trade.
stop_loss (Optional[StopLossRequest]): For orders with multiple legs, an order to exit a losing trade.
stop_price (float): The price at which the stop order is converted to a market order or a stop limit
Expand Down Expand Up @@ -507,7 +507,7 @@ class TrailingStopOrderRequest(OrderRequest):
extended_hours (Optional[float]): Whether the order can be executed during regular market hours.
client_order_id (Optional[str]): A string to identify which client submitted the order.
order_class (Optional[OrderClass]): The class of the order. Simple orders have no other legs.
legs (Optional[Union[List[OptionLegRequest], List[OrderRequest]]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
legs (Optional[List[OptionLegRequest]]): For multi-leg option orders, the legs of the order. At most 4 legs are allowed for options.
take_profit (Optional[TakeProfitRequest]): For orders with multiple legs, an order to exit a profitable trade.
stop_loss (Optional[StopLossRequest]): For orders with multiple legs, an order to exit a losing trade.
trail_price (Optional[float]): The absolute price difference by which the trailing stop will trail.
Expand Down

0 comments on commit cf5f311

Please sign in to comment.