Skip to main content

TransactionCode

Enum TransactionCode 

Source
pub enum TransactionCode {
Show 56 variants Assignment, Adjustment, Allocation, AutoExercise, AutoFx, AwayTrade, BuyIn, BorrowFee, Cancelled, Closing, CashDelivery, ComplexPosition, Correction, Crossing, DualAgent, Etf, Expired, Exercise, Guaranteed, HighestCost, HfInvestment, HfRedemption, InternalTransfer, Affiliate, Investor, MarginLiquidation, Lifo, Loan, LongTermGain, ManualEntry, MaxLoss, MinLongTermGain, MaxShortTermGain, MinShortTermGain, ManualExercise, Opening, Partial, FracRiskless, FracPrincipal, PriceImprovement, PostAccrual, Principal, Reinvestment, Redemption, Reopen, Reverse, Reimbursement, SolicitedIb, SpecificLot, SolicitedOther, ShortSettlement, ShortTermGain, StockYield, Transfer, WashSale, Unknown,
}
Expand description

Transaction code

Comprehensive list of IB transaction classification codes. These codes appear in notes fields and can be combined (e.g., “C;W” for closing + wash sale). They provide critical context for tax reporting and trade classification.

Variants§

§

Assignment

Assignment - Option assignment triggering stock delivery

§

Adjustment

Adjustment - Manual adjustment affecting cost basis

§

Allocation

Allocation - Trade allocation to sub-account (master/sub allocation)

§

AutoExercise

Auto Exercise - Automatic exercise (dividend-related, exercise before ex-div)

§

AutoFx

Auto FX - AutoFX currency conversion for settlement

§

AwayTrade

Away Trade - Trade executed away from IB (third-party execution)

§

BuyIn

Buy-In - Forced purchase to cover failed delivery (forced short cover)

§

BorrowFee

Borrow - Securities borrowing fee (lending charge)

§

Cancelled

Cancellation - Trade cancelled/busted (trade reversed)

§

Closing

Closing - Closing trade (reduces position)

§

CashDelivery

Cash Delivery - Cash delivery for exercise (cash vs physical)

§

ComplexPosition

Complex Position - Complex/combo position (multi-leg strategy)

§

Correction

Correction - Trade correction (amended execution)

§

Crossing

Crossing - Internal IB cross (matched internally)

§

DualAgent

Dual Agent - IB dual agent capacity (disclosed dual role)

§

Etf

ETF - ETF creation/redemption (in-kind basket)

§

Expired

Expired - From expired position (option/warrant expiry)

§

Exercise

Exercise - Option exercise (long option exercised)

§

Guaranteed

Guaranteed - Guaranteed account segment (special margin)

§

HighestCost

Highest Cost - Highest cost tax lot (tax lot selection)

§

HfInvestment

HF Investment - Hedge fund investment (fund subscription)

§

HfRedemption

HF Redemption - Hedge fund redemption (fund redemption)

§

InternalTransfer

Internal - Internal transfer (between IB accounts)

§

Affiliate

Affiliate - Affiliate execution (related party trade)

§

Investor

Investor - Investment from investor (capital contribution)

§

MarginLiquidation

Margin Violation - Liquidation due to margin (forced liquidation)

§

Lifo

LIFO - LIFO tax lot (tax lot selection)

§

Loan

Loan - Securities lending income (lending income)

§

LongTermGain

Long-Term - Long-term gain/loss (holding > 1 year)

§

ManualEntry

Manual - Manual IB entry (manual adjustment)

§

MaxLoss

Max Loss - Maximize losses (tax optimization)

§

MinLongTermGain

Min LT Gain - Minimize long-term gain (tax optimization)

§

MaxShortTermGain

Max ST Gain - Maximize short-term gain (tax optimization)

§

MinShortTermGain

Min ST Gain - Minimize short-term gain (tax optimization)

§

ManualExercise

Manual Exercise - Manual exercise (discretionary exercise)

§

Opening

Opening - Opening trade (new position)

§

Partial

Partial - Partial execution (partial fill)

§

FracRiskless

Frac Riskless - Fractional riskless principal (fractional share method)

§

FracPrincipal

Frac Principal - Fractional principal (fractional share method)

§

PriceImprovement

Price Improvement - Better than quoted (price improvement)

§

PostAccrual

Post Accrual - Accrual posting (accrual entry)

§

Principal

Principal - IB principal execution (principal trade)

§

Reinvestment

Reinvestment - Dividend reinvestment (DRIP)

§

Redemption

Redemption - Capital distribution (fund redemption)

§

Reopen

Reopen - Position reopened (wash sale reopen)

§

Reverse

Reverse - Accrual reversal (accounting reversal)

§

Reimbursement

Reimbursement - Fee refund (expense refund)

§

SolicitedIb

Solicited IB - IB solicited order (IB-initiated)

§

SpecificLot

Specific Lot - Specific tax lot (tax lot selection)

§

SolicitedOther

Solicited Other - Third-party solicited (broker-solicited)

§

ShortSettlement

Short Settlement - T+0 or T+1 settlement (accelerated settle)

§

ShortTermGain

Short-Term - Short-term gain/loss (holding <= 1 year)

§

StockYield

Stock Yield - Stock yield eligible (lending eligible)

§

Transfer

Transfer - Position transfer

§

WashSale

Wash Sale - Wash sale (loss disallowed)

§

Unknown

Unknown code

Trait Implementations§

Source§

impl Clone for TransactionCode

Source§

fn clone(&self) -> TransactionCode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransactionCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TransactionCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for TransactionCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for TransactionCode

Source§

fn eq(&self, other: &TransactionCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TransactionCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for TransactionCode

Source§

impl StructuralPartialEq for TransactionCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,