//! Enums for the trading API, from `alpaca/trading/enums.py`.
//!
//! Generated by `scripts/gen_enums.py` from `alpaca/trading/enums.py`
//! at alpaca-py revision `cc4cb3b`. Do not edit by hand — hand-written
//! `impl` blocks belong in the sibling `enums_ext.rs`.
use crate::types::wire::wire_enum;
wire_enum! {
/// 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
pub enum ActivityType {
/// `FILL`
Fill => "FILL",
/// `ACATC`
Acatc => "ACATC",
/// `ACATS`
Acats => "ACATS",
/// `CFEE`
Cfee => "CFEE",
/// `CIL`
Cil => "CIL",
/// `CSD`
Csd => "CSD",
/// `CSW`
Csw => "CSW",
/// `DIV`
Div => "DIV",
/// `DIVCGL`
Divcgl => "DIVCGL",
/// `DIVCGS`
Divcgs => "DIVCGS",
/// `DIVNRA`
Divnra => "DIVNRA",
/// `DIVROC`
Divroc => "DIVROC",
/// `DIVTXEX`
Divtxex => "DIVTXEX",
/// `DIVWH`
Divwh => "DIVWH",
/// `EXTRD`
Extrd => "EXTRD",
/// `FEE`
Fee => "FEE",
/// `FXTRD`
Fxtrd => "FXTRD",
/// `INT`
Int => "INT",
/// `INTPNL`
Intpnl => "INTPNL",
/// `JNLC`
Jnlc => "JNLC",
/// `JNLS`
Jnls => "JNLS",
/// `MA`
Ma => "MA",
/// `MEM`
Mem => "MEM",
/// `NC`
Nc => "NC",
/// `OCT`
Oct => "OCT",
/// `OPASN`
Opasn => "OPASN",
/// `OPCSH`
Opcsh => "OPCSH",
/// `OPEXC`
Opexc => "OPEXC",
/// `OPEXP`
Opexp => "OPEXP",
/// `OPTRD`
Optrd => "OPTRD",
/// `PTC`
Ptc => "PTC",
/// `REORG`
Reorg => "REORG",
/// `SPIN`
Spin => "SPIN",
/// `SPLIT`
Split => "SPLIT",
/// `SWP`
Swp => "SWP",
/// `VOF`
Vof => "VOF",
/// `WH`
Wh => "WH",
}
}
wire_enum! {
/// Represents the type of `TradeActivity`.
///
/// Please see <https://alpaca.markets/docs/api-references/broker-api/accounts/account-activities/#attributes>
pub enum TradeActivityType {
/// `partial_fill`
PartialFill => "partial_fill",
/// `fill`
Fill => "fill",
}
}
wire_enum! {
/// Represents the status of a `NonTradeActivity`.
///
/// Please see <https://alpaca.markets/docs/api-references/broker-api/accounts/account-activities/#enumaccountactivity>
/// for more info.
pub enum NonTradeActivityStatus {
/// `executed`
Executed => "executed",
/// `correct`
Correct => "correct",
/// `canceled`
Canceled => "canceled",
}
}
wire_enum! {
/// 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 ""), mleg (required for multi-leg complex options strategies).
/// - Crypto trading: simple (or "").
pub enum OrderClass {
/// `simple`
Simple => "simple",
/// `mleg`
Mleg => "mleg",
/// `bracket`
Bracket => "bracket",
/// `oco`
Oco => "oco",
/// `oto`
Oto => "oto",
}
}
wire_enum! {
/// 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`.
pub enum OrderType {
/// `market`
Market => "market",
/// `limit`
Limit => "limit",
/// `stop`
Stop => "stop",
/// `stop_limit`
StopLimit => "stop_limit",
/// `trailing_stop`
TrailingStop => "trailing_stop",
}
}
wire_enum! {
/// Represents what side this order was executed on.
pub enum OrderSide {
/// `buy`
Buy => "buy",
/// `sell`
Sell => "sell",
}
}
wire_enum! {
/// 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
pub enum OrderStatus {
/// `new`
New => "new",
/// `partially_filled`
PartiallyFilled => "partially_filled",
/// `filled`
Filled => "filled",
/// `done_for_day`
DoneForDay => "done_for_day",
/// `canceled`
Canceled => "canceled",
/// `expired`
Expired => "expired",
/// `replaced`
Replaced => "replaced",
/// `pending_cancel`
PendingCancel => "pending_cancel",
/// `pending_replace`
PendingReplace => "pending_replace",
/// `pending_review`
PendingReview => "pending_review",
/// `accepted`
Accepted => "accepted",
/// `pending_new`
PendingNew => "pending_new",
/// `accepted_for_bidding`
AcceptedForBidding => "accepted_for_bidding",
/// `stopped`
Stopped => "stopped",
/// `rejected`
Rejected => "rejected",
/// `suspended`
Suspended => "suspended",
/// `calculated`
Calculated => "calculated",
/// `held`
Held => "held",
}
}
wire_enum! {
/// 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.
pub enum AssetClass {
/// `us_equity`
UsEquity => "us_equity",
/// `us_option`
UsOption => "us_option",
/// `crypto`
Crypto => "crypto",
/// `crypto_perp`
CryptoPerp => "crypto_perp",
}
}
wire_enum! {
/// Represents the various states for an Asset's lifecycle
pub enum AssetStatus {
/// `active`
Active => "active",
/// `inactive`
Inactive => "inactive",
}
}
wire_enum! {
/// Represents the current exchanges Alpaca supports.
pub enum AssetExchange {
/// `AMEX`
Amex => "AMEX",
/// `ARCA`
Arca => "ARCA",
/// `ASCX`
Ascx => "ASCX",
/// `BATS`
Bats => "BATS",
/// `NYSE`
Nyse => "NYSE",
/// `NASDAQ`
Nasdaq => "NASDAQ",
/// `NYSEARCA`
Nysearca => "NYSEARCA",
/// `FTXU`
Ftxu => "FTXU",
/// `CBSE`
Cbse => "CBSE",
/// `GNSS`
Gnss => "GNSS",
/// `ERSX`
Ersx => "ERSX",
/// `OTC`
Otc => "OTC",
/// `CRYPTO`
Crypto => "CRYPTO",
/// The empty value.
Empty => "",
}
}
wire_enum! {
/// Represents what side this position is.
pub enum PositionSide {
/// `short`
Short => "short",
/// `long`
Long => "long",
}
}
wire_enum! {
/// 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.
pub enum TimeInForce {
/// `day`
Day => "day",
/// `gtc`
Gtc => "gtc",
/// `opg`
Opg => "opg",
/// `cls`
Cls => "cls",
/// `ioc`
Ioc => "ioc",
/// `fok`
Fok => "fok",
}
}
wire_enum! {
/// The general types of corporate action events.
///
/// Learn more here: <https://alpaca.markets/docs/api-references/trading-api/corporate-actions-announcements/>
pub enum CorporateActionType {
/// `dividend`
Dividend => "dividend",
/// `merger`
Merger => "merger",
/// `spinoff`
Spinoff => "spinoff",
/// `split`
Split => "split",
}
}
wire_enum! {
/// 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/>
pub enum CorporateActionSubType {
/// `cash`
Cash => "cash",
/// `stock`
Stock => "stock",
/// `merger_update`
MergerUpdate => "merger_update",
/// `merger_completion`
MergerCompletion => "merger_completion",
/// `spinoff`
Spinoff => "spinoff",
/// `stock_split`
StockSplit => "stock_split",
/// `unit_split`
UnitSplit => "unit_split",
/// `reverse_split`
ReverseSplit => "reverse_split",
/// `recapitalization`
Recapitalization => "recapitalization",
}
}
wire_enum! {
/// The various statuses each brokerage account can take during its lifetime
///
/// see <https://alpaca.markets/docs/broker/api-references/accounts/accounts/#account-status>
pub enum AccountStatus {
/// `ACCOUNT_CLOSED`
AccountClosed => "ACCOUNT_CLOSED",
/// `ACCOUNT_UPDATED`
AccountUpdated => "ACCOUNT_UPDATED",
/// `ACTION_REQUIRED`
ActionRequired => "ACTION_REQUIRED",
/// `ACTIVE`
Active => "ACTIVE",
/// `AML_REVIEW`
AmlReview => "AML_REVIEW",
/// `APPROVAL_PENDING`
ApprovalPending => "APPROVAL_PENDING",
/// `APPROVED`
Approved => "APPROVED",
/// `DISABLED`
Disabled => "DISABLED",
/// `DISABLE_PENDING`
DisablePending => "DISABLE_PENDING",
/// `EDITED`
Edited => "EDITED",
/// `INACTIVE`
Inactive => "INACTIVE",
/// `KYC_SUBMITTED`
KycSubmitted => "KYC_SUBMITTED",
/// `LIMITED`
Limited => "LIMITED",
/// `ONBOARDING`
Onboarding => "ONBOARDING",
/// `PAPER_ONLY`
PaperOnly => "PAPER_ONLY",
/// `REAPPROVAL_PENDING`
ReapprovalPending => "REAPPROVAL_PENDING",
/// `REJECTED`
Rejected => "REJECTED",
/// `RESUBMITTED`
Resubmitted => "RESUBMITTED",
/// `SIGNED_UP`
SignedUp => "SIGNED_UP",
/// `SUBMISSION_FAILED`
SubmissionFailed => "SUBMISSION_FAILED",
/// `SUBMITTED`
Submitted => "SUBMITTED",
}
}
wire_enum! {
/// The `CorporateActionDateType` values accepted by the API.
pub enum CorporateActionDateType {
/// `declaration_date`
DeclarationDate => "declaration_date",
/// `ex_date`
ExDate => "ex_date",
/// `record_date`
RecordDate => "record_date",
/// `payable_date`
PayableDate => "payable_date",
}
}
wire_enum! {
/// The `TradeEvent` values accepted by the API.
pub enum TradeEvent {
/// `accepted`
Accepted => "accepted",
/// `canceled`
Canceled => "canceled",
/// `expired`
Expired => "expired",
/// `fill`
Fill => "fill",
/// `new`
New => "new",
/// `partial_fill`
PartialFill => "partial_fill",
/// `pending_cancel`
PendingCancel => "pending_cancel",
/// `pending_new`
PendingNew => "pending_new",
/// `pending_replace`
PendingReplace => "pending_replace",
/// `rejected`
Rejected => "rejected",
/// `replaced`
Replaced => "replaced",
/// `restated`
Restated => "restated",
}
}
wire_enum! {
/// The `QueryOrderStatus` values accepted by the API.
pub enum QueryOrderStatus {
/// `open`
Open => "open",
/// `closed`
Closed => "closed",
/// `all`
All => "all",
}
}
wire_enum! {
/// 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.
pub enum DTBPCheck {
/// `both`
Both => "both",
/// `entry`
Entry => "entry",
/// `exit`
Exit => "exit",
}
}
wire_enum! {
/// 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.
pub enum PDTCheck {
/// `both`
Both => "both",
/// `entry`
Entry => "entry",
/// `exit`
Exit => "exit",
}
}
wire_enum! {
/// Used for controlling when an Account will receive a trade confirmation email.
///
/// please see <https://docs.alpaca.markets/reference/getaccountconfig>
/// for more info.
pub enum TradeConfirmationEmail {
/// `all`
All => "all",
/// `none`
None => "none",
}
}
wire_enum! {
/// Represents the exercise style of options
pub enum ExerciseStyle {
/// `american`
American => "american",
/// `european`
European => "european",
}
}
wire_enum! {
/// Represents the category of an Activity
pub enum ActivityCategory {
/// `trade_activity`
TradeActivity => "trade_activity",
/// `non_trade_activity`
NonTradeActivity => "non_trade_activity",
}
}
wire_enum! {
/// Represents what side this order was executed on.
pub enum PositionIntent {
/// `buy_to_open`
BuyToOpen => "buy_to_open",
/// `buy_to_close`
BuyToClose => "buy_to_close",
/// `sell_to_open`
SellToOpen => "sell_to_open",
/// `sell_to_close`
SellToClose => "sell_to_close",
}
}