trading.indicators.calculations.true_range
trading.indicators.calculations.true_range
TrueRange
TrueRange()
Bases: Indicator[float]
The volatility during a single trading period.
Initializes TrueRange.
Source code in src\contango\trading\indicators\calculations\true_range.py
29 30 31 32 33 | |
update
update(high: USD, low: USD, close: USD) -> float
Updates the state of the true range for every bar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
high
|
USD
|
The highest price reached in USD for a bar. |
required |
low
|
USD
|
The lowest price reached in USD for a bar. |
required |
close
|
USD
|
The closing price in USD for a bar. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The true range for the bar. |
Source code in src\contango\trading\indicators\calculations\true_range.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |