Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat-mleg-option-orders' into fe…
Browse files Browse the repository at this point in the history
…at-mleg-orders
  • Loading branch information
aarjaneiro committed Jan 18, 2025
2 parents 2467e7d + 86b69ec commit 6894195
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion alpaca/trading/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class OrderClass(str, Enum):
The order classes supported by Alpaca vary based on the order's security type.
The following provides a comprehensive breakdown of the supported order classes for each category:
- Equity trading: simple (or ""), oco, oto, bracket.
- Options trading: simple (or ""), mleg (required for multi-leg complex option strategies).
- Options trading: simple (or ""), mleg (required for multi-leg complex options strategies).
- Crypto trading: simple (or "").
"""

Expand Down
7 changes: 4 additions & 3 deletions alpaca/trading/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ class Order(ModelWithID):
trail_price: Optional[str] = None
hwm: Optional[str] = None
position_intent: Optional[PositionIntent] = None
ratio_qty: Optional[Union[str, float]] = None

# internal to the SDK
_is_sub_mleg: bool = False
Expand Down Expand Up @@ -536,9 +537,9 @@ class TradeAccount(ModelWithID):
(inclusive of today)
options_buying_power (Optional[str]): Your buying power for options trading
options_approved_level (Optional[int]): The options trading level that was approved for this account.
0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Multi-leg.
0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.
options_trading_level (Optional[int]): The effective options trading level of the account. This is the minimum between account options_approved_level and account configurations max_options_trading_level.
0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long, 3=Multi-leg.
0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long, 3=Spreads/Straddles.
"""

account_number: str
Expand Down Expand Up @@ -589,7 +590,7 @@ class AccountConfiguration(BaseModel):
suspend_trade (bool): If true Account becomes unable to submit new orders
trade_confirm_email (TradeConfirmationEmail): Controls whether Trade confirmation emails are sent.
ptp_no_exception_entry (bool): If set to true then Alpaca will accept orders for PTP symbols with no exception. Default is false.
max_options_trading_level (Optional[int]): The desired maximum options trading level. 0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Multi-leg.
max_options_trading_level (Optional[int]): The desired maximum options trading level. 0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.
"""

dtbp_check: DTBPCheck
Expand Down
2 changes: 1 addition & 1 deletion alpaca/trading/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class OrderRequest(NonEmptyRequest):
Required for mleg order class.
notional (Optional[float]): The base currency value of the shares to trade. For stocks, only works with MarketOrders.
**Does not work with qty**.
side (Optional[OrderSide]): Whether the order will buy or sell the asset. Required for all order classes other than mleg.
side (Optional[OrderSide]): Whether the order will buy or sell the asset. Either side or position_intent is required for all order classes other than mleg.
type (OrderType): The execution logic type of the order (market, limit, etc).
time_in_force (TimeInForce): The expiration logic of the order.
extended_hours (Optional[float]): Whether the order can be executed during regular market hours.
Expand Down

0 comments on commit 6894195

Please sign in to comment.