diff --git a/alpaca/trading/enums.py b/alpaca/trading/enums.py index 85fc472e..84d4b54e 100644 --- a/alpaca/trading/enums.py +++ b/alpaca/trading/enums.py @@ -346,7 +346,7 @@ class TradeConfirmationEmail(str, Enum): """ Used for controlling when an Account will receive a trade confirmation email. - please see https://alpaca.markets/docs/api-references/broker-api/trading/trading-configurations/#attributes + please see https://docs.alpaca.markets/reference/getaccountconfig for more info. """ diff --git a/alpaca/trading/models.py b/alpaca/trading/models.py index 73d94e8d..82cddedd 100644 --- a/alpaca/trading/models.py +++ b/alpaca/trading/models.py @@ -544,6 +544,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_option_trading_level (Optional[str]): The desired maximum option trading level. 0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put. """ dtbp_check: DTBPCheck @@ -554,6 +555,7 @@ class AccountConfiguration(BaseModel): suspend_trade: bool trade_confirm_email: TradeConfirmationEmail ptp_no_exception_entry: bool + max_option_trading_level: Optional[str] = None class CorporateActionAnnouncement(ModelWithID): diff --git a/tests/trading/trading_client/test_account_routes.py b/tests/trading/trading_client/test_account_routes.py index b6fefb4d..5dd1e1a2 100644 --- a/tests/trading/trading_client/test_account_routes.py +++ b/tests/trading/trading_client/test_account_routes.py @@ -64,7 +64,8 @@ def test_get_account_configurations(reqmock: Mocker, trading_client: TradingClie "max_margin_multiplier": "4", "pdt_check": "entry", "trade_confirm_email": "all", - "ptp_no_exception_entry": false + "ptp_no_exception_entry": false, + "max_option_trading_level": "1" } """, ) @@ -72,6 +73,7 @@ def test_get_account_configurations(reqmock: Mocker, trading_client: TradingClie account_configurations = trading_client.get_account_configurations() assert reqmock.called_once assert isinstance(account_configurations, AccountConfiguration) + assert account_configurations.max_option_trading_level == "1" def test_set_account_configurations(reqmock: Mocker, trading_client: TradingClient):