Enums#

OrderClass#

enum alpaca.trading.enums.OrderClass(value)#

Represents what class of order this is.

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 “”). - Crypto trading: simple (or “”).

Member Type:

str

Valid values are as follows:

SIMPLE = <OrderClass.SIMPLE: 'simple'>#
BRACKET = <OrderClass.BRACKET: 'bracket'>#
OCO = <OrderClass.OCO: 'oco'>#
OTO = <OrderClass.OTO: 'oto'>#

OrderType#

enum alpaca.trading.enums.OrderType(value)#

Represents what type of order this is.

The order types supported by Alpaca vary based on the order’s security type. The following provides a comprehensive breakdown of the supported order types for each category: - Equity trading: market, limit, stop, stop_limit, trailing_stop. - Options trading: market, limit, stop, stop_limit. - Crypto trading: market, limit, stop_limit.

Member Type:

str

Valid values are as follows:

MARKET = <OrderType.MARKET: 'market'>#
LIMIT = <OrderType.LIMIT: 'limit'>#
STOP = <OrderType.STOP: 'stop'>#
STOP_LIMIT = <OrderType.STOP_LIMIT: 'stop_limit'>#
TRAILING_STOP = <OrderType.TRAILING_STOP: 'trailing_stop'>#

OrderSide#

enum alpaca.trading.enums.OrderSide(value)#

Represents what side this order was executed on.

Member Type:

str

Valid values are as follows:

BUY = <OrderSide.BUY: 'buy'>#
SELL = <OrderSide.SELL: 'sell'>#

TimeInForce#

enum alpaca.trading.enums.TimeInForce(value)#

Represents the various time in force options for an Order.

The Time-In-Force values supported by Alpaca vary based on the order’s security type. Here is a breakdown of the supported TIFs for each specific security type: - Equity trading: day, gtc, opg, cls, ioc, fok. - Options trading: day. - Crypto trading: gtc, ioc. Below are the descriptions of each TIF: - day: A day order is eligible for execution only on the day it is live. By default, the order is only valid during Regular Trading Hours (9:30am - 4:00pm ET). If unfilled after the closing auction, it is automatically canceled. If submitted after the close, it is queued and submitted the following trading day. However, if marked as eligible for extended hours, the order can also execute during supported extended hours. - gtc: The order is good until canceled. Non-marketable GTC limit orders are subject to price adjustments to offset corporate actions affecting the issue. We do not currently support Do Not Reduce(DNR) orders to opt out of such price adjustments. - opg: Use this TIF with a market/limit order type to submit “market on open” (MOO) and “limit on open” (LOO) orders. This order is eligible to execute only in the market opening auction. Any unfilled orders after the open will be cancelled. OPG orders submitted after 9:28am but before 7:00pm ET will be rejected. OPG orders submitted after 7:00pm will be queued and routed to the following day’s opening auction. On open/on close orders are routed to the primary exchange. Such orders do not necessarily execute exactly at 9:30am / 4:00pm ET but execute per the exchange’s auction rules. - cls: Use this TIF with a market/limit order type to submit “market on close” (MOC) and “limit on close” (LOC) orders. This order is eligible to execute only in the market closing auction. Any unfilled orders after the close will be cancelled. CLS orders submitted after 3:50pm but before 7:00pm ET will be rejected. CLS orders submitted after 7:00pm will be queued and routed to the following day’s closing auction. Only available with API v2. - ioc: An Immediate Or Cancel (IOC) order requires all or part of the order to be executed immediately. Any unfilled portion of the order is canceled. Only available with API v2. Most market makers who receive IOC orders will attempt to fill the order on a principal basis only, and cancel any unfilled balance. On occasion, this can result in the entire order being cancelled if the market maker does not have any existing inventory of the security in question. - fok: A Fill or Kill (FOK) order is only executed if the entire order quantity can be filled, otherwise the order is canceled. Only available with API v2.

Member Type:

str

Valid values are as follows:

DAY = <TimeInForce.DAY: 'day'>#
GTC = <TimeInForce.GTC: 'gtc'>#
OPG = <TimeInForce.OPG: 'opg'>#
CLS = <TimeInForce.CLS: 'cls'>#
IOC = <TimeInForce.IOC: 'ioc'>#
FOK = <TimeInForce.FOK: 'fok'>#

OrderStatus#

enum alpaca.trading.enums.OrderStatus(value)#

Represents the various states an Order can be in.

please see https://alpaca.markets/docs/api-references/broker-api/trading/orders/#order-status for more info

Member Type:

str

Valid values are as follows:

NEW = <OrderStatus.NEW: 'new'>#
PARTIALLY_FILLED = <OrderStatus.PARTIALLY_FILLED: 'partially_filled'>#
FILLED = <OrderStatus.FILLED: 'filled'>#
DONE_FOR_DAY = <OrderStatus.DONE_FOR_DAY: 'done_for_day'>#
CANCELED = <OrderStatus.CANCELED: 'canceled'>#
EXPIRED = <OrderStatus.EXPIRED: 'expired'>#
REPLACED = <OrderStatus.REPLACED: 'replaced'>#
PENDING_CANCEL = <OrderStatus.PENDING_CANCEL: 'pending_cancel'>#
PENDING_REPLACE = <OrderStatus.PENDING_REPLACE: 'pending_replace'>#
PENDING_REVIEW = <OrderStatus.PENDING_REVIEW: 'pending_review'>#
ACCEPTED = <OrderStatus.ACCEPTED: 'accepted'>#
PENDING_NEW = <OrderStatus.PENDING_NEW: 'pending_new'>#
ACCEPTED_FOR_BIDDING = <OrderStatus.ACCEPTED_FOR_BIDDING: 'accepted_for_bidding'>#
STOPPED = <OrderStatus.STOPPED: 'stopped'>#
REJECTED = <OrderStatus.REJECTED: 'rejected'>#
SUSPENDED = <OrderStatus.SUSPENDED: 'suspended'>#
CALCULATED = <OrderStatus.CALCULATED: 'calculated'>#
HELD = <OrderStatus.HELD: 'held'>#

AssetClass#

enum alpaca.trading.enums.AssetClass(value)#

This represents the category to which the asset belongs to. It serves to identify the nature of the financial instrument, with options including “us_equity” for U.S. equities, “us_option” for U.S. options, and “crypto” for cryptocurrencies.

Member Type:

str

Valid values are as follows:

US_EQUITY = <AssetClass.US_EQUITY: 'us_equity'>#
US_OPTION = <AssetClass.US_OPTION: 'us_option'>#
CRYPTO = <AssetClass.CRYPTO: 'crypto'>#

AssetStatus#

enum alpaca.trading.enums.AssetStatus(value)#

Represents the various states for an Asset’s lifecycle

Member Type:

str

Valid values are as follows:

ACTIVE = <AssetStatus.ACTIVE: 'active'>#
INACTIVE = <AssetStatus.INACTIVE: 'inactive'>#

AssetExchange#

enum alpaca.trading.enums.AssetExchange(value)#

Represents the current exchanges Alpaca supports.

Member Type:

str

Valid values are as follows:

AMEX = <AssetExchange.AMEX: 'AMEX'>#
ARCA = <AssetExchange.ARCA: 'ARCA'>#
BATS = <AssetExchange.BATS: 'BATS'>#
NYSE = <AssetExchange.NYSE: 'NYSE'>#
NASDAQ = <AssetExchange.NASDAQ: 'NASDAQ'>#
NYSEARCA = <AssetExchange.NYSEARCA: 'NYSEARCA'>#
FTXU = <AssetExchange.FTXU: 'FTXU'>#
CBSE = <AssetExchange.CBSE: 'CBSE'>#
GNSS = <AssetExchange.GNSS: 'GNSS'>#
ERSX = <AssetExchange.ERSX: 'ERSX'>#
OTC = <AssetExchange.OTC: 'OTC'>#
CRYPTO = <AssetExchange.CRYPTO: 'CRYPTO'>#
EMPTY = <AssetExchange.EMPTY: ''>#

PositionSide#

enum alpaca.trading.enums.PositionSide(value)#

Represents what side this position is.

Member Type:

str

Valid values are as follows:

SHORT = <PositionSide.SHORT: 'short'>#
LONG = <PositionSide.LONG: 'long'>#

AccountStatus#

enum alpaca.trading.enums.AccountStatus(value)#

The various statuses each brokerage account can take during its lifetime

see https://alpaca.markets/docs/broker/api-references/accounts/accounts/#account-status

Member Type:

str

Valid values are as follows:

ACCOUNT_CLOSED = <AccountStatus.ACCOUNT_CLOSED: 'ACCOUNT_CLOSED'>#
ACCOUNT_UPDATED = <AccountStatus.ACCOUNT_UPDATED: 'ACCOUNT_UPDATED'>#
ACTION_REQUIRED = <AccountStatus.ACTION_REQUIRED: 'ACTION_REQUIRED'>#
ACTIVE = <AccountStatus.ACTIVE: 'ACTIVE'>#
AML_REVIEW = <AccountStatus.AML_REVIEW: 'AML_REVIEW'>#
APPROVAL_PENDING = <AccountStatus.APPROVAL_PENDING: 'APPROVAL_PENDING'>#
APPROVED = <AccountStatus.APPROVED: 'APPROVED'>#
DISABLED = <AccountStatus.DISABLED: 'DISABLED'>#
DISABLE_PENDING = <AccountStatus.DISABLE_PENDING: 'DISABLE_PENDING'>#
EDITED = <AccountStatus.EDITED: 'EDITED'>#
INACTIVE = <AccountStatus.INACTIVE: 'INACTIVE'>#
KYC_SUBMITTED = <AccountStatus.KYC_SUBMITTED: 'KYC_SUBMITTED'>#
LIMITED = <AccountStatus.LIMITED: 'LIMITED'>#
ONBOARDING = <AccountStatus.ONBOARDING: 'ONBOARDING'>#
PAPER_ONLY = <AccountStatus.PAPER_ONLY: 'PAPER_ONLY'>#
REAPPROVAL_PENDING = <AccountStatus.REAPPROVAL_PENDING: 'REAPPROVAL_PENDING'>#
REJECTED = <AccountStatus.REJECTED: 'REJECTED'>#
RESUBMITTED = <AccountStatus.RESUBMITTED: 'RESUBMITTED'>#
SIGNED_UP = <AccountStatus.SIGNED_UP: 'SIGNED_UP'>#
SUBMISSION_FAILED = <AccountStatus.SUBMISSION_FAILED: 'SUBMISSION_FAILED'>#
SUBMITTED = <AccountStatus.SUBMITTED: 'SUBMITTED'>#

ActivityType#

enum alpaca.trading.enums.ActivityType(value)#

Represents what kind of Activity an instance of TradeActivity or NonTradeActivity is.

Please see https://alpaca.markets/docs/api-references/broker-api/accounts/account-activities/#enumactivitytype for descriptions of each of the types

Member Type:

str

Valid values are as follows:

FILL = <ActivityType.FILL: 'FILL'>#
ACATC = <ActivityType.ACATC: 'ACATC'>#
ACATS = <ActivityType.ACATS: 'ACATS'>#
CIL = <ActivityType.CIL: 'CIL'>#
CSD = <ActivityType.CSD: 'CSD'>#
CSW = <ActivityType.CSW: 'CSW'>#
DIV = <ActivityType.DIV: 'DIV'>#
DIVCGL = <ActivityType.DIVCGL: 'DIVCGL'>#
DIVCGS = <ActivityType.DIVCGS: 'DIVCGS'>#
DIVNRA = <ActivityType.DIVNRA: 'DIVNRA'>#
DIVROC = <ActivityType.DIVROC: 'DIVROC'>#
DIVTXEX = <ActivityType.DIVTXEX: 'DIVTXEX'>#
FEE = <ActivityType.FEE: 'FEE'>#
INT = <ActivityType.INT: 'INT'>#
JNLC = <ActivityType.JNLC: 'JNLC'>#
JNLS = <ActivityType.JNLS: 'JNLS'>#
MA = <ActivityType.MA: 'MA'>#
PTC = <ActivityType.PTC: 'PTC'>#
REORG = <ActivityType.REORG: 'REORG'>#
SPIN = <ActivityType.SPIN: 'SPIN'>#
SPLIT = <ActivityType.SPLIT: 'SPLIT'>#

TradeActivityType#

enum alpaca.trading.enums.TradeActivityType(value)#

Represents the type of TradeActivity.

Please see https://alpaca.markets/docs/api-references/broker-api/accounts/account-activities/#attributes

Member Type:

str

Valid values are as follows:

PARTIAL_FILL = <TradeActivityType.PARTIAL_FILL: 'partial_fill'>#
FILL = <TradeActivityType.FILL: 'fill'>#

NonTradeActivityStatus#

enum alpaca.trading.enums.NonTradeActivityStatus(value)#

Represents the status of a NonTradeActivity.

Please see https://alpaca.markets/docs/api-references/broker-api/accounts/account-activities/#enumaccountactivity for more info.

Member Type:

str

Valid values are as follows:

EXECUTED = <NonTradeActivityStatus.EXECUTED: 'executed'>#
CORRECT = <NonTradeActivityStatus.CORRECT: 'correct'>#
CANCELED = <NonTradeActivityStatus.CANCELED: 'canceled'>#

CorporateActionType#

enum alpaca.trading.enums.CorporateActionType(value)#

The general types of corporate action events.

Learn more here: https://alpaca.markets/docs/api-references/trading-api/corporate-actions-announcements/

Member Type:

str

Valid values are as follows:

DIVIDEND = <CorporateActionType.DIVIDEND: 'dividend'>#
MERGER = <CorporateActionType.MERGER: 'merger'>#
SPINOFF = <CorporateActionType.SPINOFF: 'spinoff'>#
SPLIT = <CorporateActionType.SPLIT: 'split'>#

CorporateActionSubType#

enum alpaca.trading.enums.CorporateActionSubType(value)#

The specific types of corporate actions. Each subtype is related to CorporateActionType.

Learn more here: https://alpaca.markets/docs/api-references/trading-api/corporate-actions-announcements/

Member Type:

str

Valid values are as follows:

CASH = <CorporateActionSubType.CASH: 'cash'>#
STOCK = <CorporateActionSubType.STOCK: 'stock'>#
MERGER_UPDATE = <CorporateActionSubType.MERGER_UPDATE: 'merger_update'>#
MERGER_COMPLETION = <CorporateActionSubType.MERGER_COMPLETION: 'merger_completion'>#
SPINOFF = <CorporateActionSubType.SPINOFF: 'spinoff'>#
STOCK_SPLIT = <CorporateActionSubType.STOCK_SPLIT: 'stock_split'>#
UNIT_SPLIT = <CorporateActionSubType.UNIT_SPLIT: 'unit_split'>#
REVERSE_SPLIT = <CorporateActionSubType.REVERSE_SPLIT: 'reverse_split'>#
RECAPITALIZATION = <CorporateActionSubType.RECAPITALIZATION: 'recapitalization'>#

CorporateActionDateType#

enum alpaca.trading.enums.CorporateActionDateType(value)#
Member Type:

str

Valid values are as follows:

DECLARATION_DATE = <CorporateActionDateType.DECLARATION_DATE: 'declaration_date'>#
EX_DATE = <CorporateActionDateType.EX_DATE: 'ex_date'>#
RECORD_DATE = <CorporateActionDateType.RECORD_DATE: 'record_date'>#
PAYABLE_DATE = <CorporateActionDateType.PAYABLE_DATE: 'payable_date'>#

DTBPCheck#

enum alpaca.trading.enums.DTBPCheck(value)#

Specifies when to run a DTBP check for an account.

NOTE: These values are currently the same as PDTCheck however they are not guaranteed to be in sync the future

please see https://alpaca.markets/docs/api-references/broker-api/trading/trading-configurations/#attributes for more info.

Member Type:

str

Valid values are as follows:

BOTH = <DTBPCheck.BOTH: 'both'>#
ENTRY = <DTBPCheck.ENTRY: 'entry'>#
EXIT = <DTBPCheck.EXIT: 'exit'>#

PDTCheck#

enum alpaca.trading.enums.PDTCheck(value)#

Specifies when to run a PDT check for an account.

NOTE: These values are currently the same as DTBPCheck however they are not guaranteed to be in sync the future

please see https://alpaca.markets/docs/api-references/broker-api/trading/trading-configurations/#attributes for more info.

Member Type:

str

Valid values are as follows:

BOTH = <PDTCheck.BOTH: 'both'>#
ENTRY = <PDTCheck.ENTRY: 'entry'>#
EXIT = <PDTCheck.EXIT: 'exit'>#

TradeConfirmationEmail#

enum alpaca.trading.enums.TradeConfirmationEmail(value)#

Used for controlling when an Account will receive a trade confirmation email.

please see https://docs.alpaca.markets/reference/getaccountconfig for more info.

Member Type:

str

Valid values are as follows:

ALL = <TradeConfirmationEmail.ALL: 'all'>#
NONE = <TradeConfirmationEmail.NONE: 'none'>#