Merge branch 'main' of https://dep.sokaris.link/vasily/TCPDashboard
This commit is contained in:
@@ -201,6 +201,67 @@ class ProcessingStats:
|
||||
}
|
||||
|
||||
|
||||
class SignalType(str, Enum):
|
||||
"""
|
||||
Types of trading signals that strategies can generate.
|
||||
"""
|
||||
BUY = "buy"
|
||||
SELL = "sell"
|
||||
HOLD = "hold"
|
||||
ENTRY_LONG = "entry_long"
|
||||
EXIT_LONG = "exit_long"
|
||||
ENTRY_SHORT = "entry_short"
|
||||
EXIT_SHORT = "exit_short"
|
||||
STOP_LOSS = "stop_loss"
|
||||
TAKE_PROFIT = "take_profit"
|
||||
|
||||
|
||||
@dataclass
|
||||
class StrategySignal:
|
||||
"""
|
||||
Container for individual strategy signals.
|
||||
|
||||
Attributes:
|
||||
timestamp: Signal timestamp (right-aligned with candle)
|
||||
symbol: Trading symbol
|
||||
timeframe: Candle timeframe
|
||||
signal_type: Type of signal (buy/sell/hold etc.)
|
||||
price: Price at which signal was generated
|
||||
confidence: Signal confidence score (0.0 to 1.0)
|
||||
metadata: Additional signal metadata (e.g., indicator values)
|
||||
"""
|
||||
timestamp: datetime
|
||||
symbol: str
|
||||
timeframe: str
|
||||
signal_type: SignalType
|
||||
price: float
|
||||
confidence: float = 1.0
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class StrategyResult:
|
||||
"""
|
||||
Container for strategy calculation results.
|
||||
|
||||
Attributes:
|
||||
timestamp: Candle timestamp (right-aligned)
|
||||
symbol: Trading symbol
|
||||
timeframe: Candle timeframe
|
||||
strategy_name: Name of the strategy that generated this result
|
||||
signals: List[StrategySignal]
|
||||
indicators_used: Dictionary of indicator values used in calculation
|
||||
metadata: Additional calculation metadata
|
||||
"""
|
||||
timestamp: datetime
|
||||
symbol: str
|
||||
timeframe: str
|
||||
strategy_name: str
|
||||
signals: List[StrategySignal]
|
||||
indicators_used: Dict[str, float]
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
# Re-export from base_collector for convenience
|
||||
__all__ = [
|
||||
'DataType',
|
||||
|
||||
Reference in New Issue
Block a user