Skip to content

Trade Sides

TradeSide

Bases: Enum

Enumeration of trade direction.

TradeSide specifies the direction of change applied to the (net) signed position quantity from the perspective of the trading account.

Value Semantics
BUY Increases the signed position quantity.
SELL Decreases the signed position quantity.
Source code in src/onesecondtrader/models/trade_sides.py
class TradeSide(enum.Enum):
    """
    Enumeration of trade direction.

    `TradeSide` specifies the direction of change applied to the (net) signed position
    quantity from the perspective of the trading account.

    | Value   | Semantics                                      |
    |---------|------------------------------------------------|
    | `BUY`   | Increases the signed position quantity.        |
    | `SELL`  | Decreases the signed position quantity.        |
    """

    BUY = enum.auto()
    SELL = enum.auto()