Source code for tradingstrategy.analysis.tradehint

"""Hint trade types.

.. warning ::

    This module is deprecated and replaced by tradeexecutor analysis modules.

"""

import enum
from typing import Optional


[docs]class TradeHintType(enum.Enum): """Add hints to the backtested trades. This help later to analyse the backtested trades and differ e.g. stop losses from normal position closes. """ open = "open" close = "close" stop_loss_triggered = "stop_loss_triggered"
[docs]class TradeHint:
[docs] def __init__(self, type: TradeHintType, message: Optional[str]=None): self.type = type self.message = message