contango.stream.indicators.state.ema_state
contango.stream.indicators.state.ema_state
EMAState
Bases: Enum
Current location of the fast EMA relative to the slow EMA for a bar.
Attributes:
| Name | Type | Description |
|---|---|---|
BELOW |
The fast EMA is below the slow EMA. |
|
ABOVE |
The fast EMA is above the slow EMA. |
get_state
classmethod
get_state(fast_ema: float, slow_ema: float) -> EMAState
Returns the state of the fast EMA relative to the slow EMA (above or below).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fast_ema
|
float
|
The fast EMA value for the current bar. |
required |
slow_ema
|
float
|
The slow EMA value for the current bar. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EMAState |
EMAState
|
Whether the fast EMA is below or above the slow EMA. |
Source code in src\contango\stream\indicators\state\ema_state.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |