from dataclasses import dataclass
from enum import IntEnum


class PositionSide(IntEnum):
    """Position direction for labeling."""

    SHORT = -1
    NEUTRAL = 0
    LONG = 1


@dataclass
class BarrierConfig:
    """Configuration for triple barrier parameters.

    Attributes:
        profit_taking_multiple: Multiple of target volatility for upper barrier. Set to 0 to disable.
        stop_loss_multiple: Multiple of target volatility for lower barrier. Set to 0 to disable.
    """

    profit_taking_multiple: float = 1.0
    stop_loss_multiple: float = 1.0

    def __post_init__(self):
        if self.profit_taking_multiple < 0:
            raise ValueError("profit_taking_multiple must be non-negative")
        if self.stop_loss_multiple < 0:
            raise ValueError("stop_loss_multiple must be non-negative")
