contango.stream.indicators.calculations.true_range
contango.stream.indicators.calculations.true_range
TrueRange
TrueRange()
Bases: Indicator[float | None]
The volatility during a single trading period.
Initializes TrueRange.
Source code in src\contango\stream\indicators\calculations\true_range.py
14 15 16 17 18 19 | |
value
property
value: float | None
Returns the latest value for the true range.
update
update(event: MarketDataEvent) -> float | None
Updates the state of the true range for every bar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
MarketDataEvent
|
The underlying event to update the true range with. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float | None
|
The true range for the bar. |
Source code in src\contango\stream\indicators\calculations\true_range.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |