Skip to content

contango.strategy.rule_based.actions.emit

contango.strategy.rule_based.actions.emit

Emit

Emit(intent: INTENT_T)

Bases: Action[TradingContext, INTENT_T], Generic[INTENT_T]

A simple action that emits an intent.

Attributes:

Name Type Description
INTENT_T

The intent type that the execute() method will always return.

Initializes Emit.

Parameters:

Name Type Description Default
intent INTENT_T

The intent to release what the action is executed.

required
Source code in src\contango\strategy\rule_based\actions\emit.py
20
21
22
23
24
25
26
27
def __init__(self, intent: INTENT_T) -> None:
    """
    Initializes `Emit`.

    Args:
        intent: The intent to release what the action is executed.
    """
    self._intent = intent

execute

execute(context: TradingContext) -> INTENT_T

Executes the Emit action.

Parameters:

Name Type Description Default
context TradingContext

The context (unused) for the current market data event.

required

Returns:

Name Type Description
INTENT_T INTENT_T

The unchanging intent to emit.

Source code in src\contango\strategy\rule_based\actions\emit.py
29
30
31
32
33
34
35
36
37
38
39
def execute(self, context: TradingContext) -> INTENT_T:
    """
    Executes the `Emit` action.

    Args:
        context: The context (unused) for the current market data event.

    Returns:
        INTENT_T: The unchanging intent to emit.
    """
    return self._intent