rvi
rvi
Classes:
| Name | Description |
|---|---|
RVI |
Relative Vigor Index - RVI |
RVI
dataclass
RVI(
*,
candles: list[Candle] = list(),
name: str = "",
timeframe: TimeFramesSource | None = None,
timeframe_fill: bool = False,
candle_life: timedelta | None = None,
candlestick: CandlestickType | str | None = None,
rounding: int | None = 4,
period: int = 14,
source: Source = "close"
)
Bases: Indicator[float | None]
Relative Vigor Index - RVI
The Relative Vigor Index, or RVI, is a popular member of the “Oscillator” family of technical indicators. although the creator of the Relative Vigor Index is unknown, its design is very similar to Stochastics except that the closing price is compared with the Open rather than the Low price for the period.
Sources
https://www.thinkmarkets.com/en/learn-to-trade/indicators-and-patterns/indicators/relative-vigor-index-rvi-indicator/
Output type: float
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period
|
int
|
How many Periods to use. Defaults to 14 |
14
|
source
|
str
|
Which input field to calculate the Indicator. Defaults to "close" |
'close'
|
Methods:
| Name | Description |
|---|---|
add_child |
Register a child indicator that shares this indicator's candles. |
add_child_after |
Register a child calculated after the parent's reading is stored. |
add_child_managed |
Register a child calculated only when explicitly invoked. |
add_state |
Register hidden state storage for incremental calculations. |
append |
Appends a Candle or a chronological ordered list of Candle's to the end of the Indicator Candle's. This will only re-sample and re-calculate the new Candles, with minor overlap. |
at |
Reading at a specific candle index — shorthand for |
at_src |
Reading at |
calculate |
Calculate the TA values, will calculate for all the Candles, |
calculate_index |
Calculate the TA values, will calculate a index range the Candles, will re-calculate |
insert |
insert a Candle or a list of Candle's to the Indicator Candles. This accepts any order or placement. This will sort, re-sample and re-calculate all Candles. |
prepend |
Prepends a Candle or a chronological ordered list of Candle's to the front of the Indicator Candle's. This will only re-sample and re-calculate the new Candles, with minor overlap. |
prev |
Previous reading — shorthand for |
prev_src |
Previous reading for this indicator's configured |
reading |
Simple method to get an indicator reading from the index |
reading_count |
Returns how many instance of the given indicator exist |
reading_period |
Will return True if the given indicator goes back as far as amount, |
recalculate |
Re-calculate this indicator value for all Candles |
series |
Retrieve the indicator readings for within the candles as a list. |
src |
Current reading for this indicator's configured |
Attributes:
| Name | Type | Description |
|---|---|---|
candle_manager |
CandleManager
|
The Candle Manager which controls TimeFrame, Trimming and collapsing |
settings |
dict
|
Retrieve the settings required to regenerate this indicator in a dictionary format. |
candle_manager
property
writable
candle_manager: CandleManager
The Candle Manager which controls TimeFrame, Trimming and collapsing
settings
property
settings: dict
Retrieve the settings required to regenerate this indicator in a dictionary format.
This property compiles the configuration details of the indicator, excluding attributes that are irrelevant for generation (e.g., candles and sub-indicators). It ensures the output dictionary is clean and contains only the necessary settings for recreating the indicator.
Special handling is included for attributes like candlestick and timeframe, ensuring
their values are properly formatted.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the indicator's settings, ready for regeneration.
- |
add_child
Register a child indicator that shares this indicator's candles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
indicator
|
Indicator
|
The child indicator to attach. |
required |
when
|
ChildWhen | str
|
When the child is calculated relative to the parent at each index.
:attr: |
BEFORE
|
Source code in hexital/core/indicator/core.py
add_child_after
Register a child calculated after the parent's reading is stored.
add_child_managed
Register a child calculated only when explicitly invoked.
Source code in hexital/core/indicator/core.py
add_state
Register hidden state storage for incremental calculations.
Source code in hexital/core/indicator/core.py
append
Appends a Candle or a chronological ordered list of Candle's to the end of the Indicator Candle's. This will only re-sample and re-calculate the new Candles, with minor overlap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
candles
|
Candles
|
The Candle or List of Candle's to append. |
required |
Source code in hexital/core/indicator/core.py
at
at(
index: int, source: Source | None = None, default: T | None = None
) -> V | T
Reading at a specific candle index — shorthand for reading.
at_src
at_src(index: int, default: T | None = None) -> V | T
Reading at index for this indicator's configured source.
calculate
Calculate the TA values, will calculate for all the Candles, where this indicator is missing
Source code in hexital/core/indicator/core.py
calculate_index
Calculate the TA values, will calculate a index range the Candles, will re-calculate
Source code in hexital/core/indicator/core.py
insert
insert a Candle or a list of Candle's to the Indicator Candles. This accepts any order or placement. This will sort, re-sample and re-calculate all Candles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
candles
|
Candles
|
The Candle or List of Candle's to prepend. |
required |
Source code in hexital/core/indicator/core.py
prepend
Prepends a Candle or a chronological ordered list of Candle's to the front of the Indicator Candle's. This will only re-sample and re-calculate the new Candles, with minor overlap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
candles
|
Candles
|
The Candle or List of Candle's to prepend. |
required |
Source code in hexital/core/indicator/core.py
prev
prev_src
Previous reading for this indicator's configured source.
reading
reading(
source: Source | None = None,
index: int | None = None,
default: T | None = None,
) -> V | T
Simple method to get an indicator reading from the index
Source code in hexital/core/indicator/core.py
reading_count
Returns how many instance of the given indicator exist
Source code in hexital/core/indicator/core.py
reading_period
Will return True if the given indicator goes back as far as amount, It's true if exactly or more than. Period will be period -1
Source code in hexital/core/indicator/core.py
recalculate
series
series(name: Source | None = None) -> list[Reading | V]
Retrieve the indicator readings for within the candles as a list.
This method collects the readings of a specified indicator for all candles and returns them as a list. If no name is provided, the generated name of the indicator is used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the indicator to retrieve.
Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
list[Reading | V]
|
List[float | dict | None]: A list containing the indicator values for
each candle. The values may be floats,
dictionaries (for complex indicators),
or |