movement
movement
Modules:
Name | Description |
---|---|
utils |
|
Functions:
Name | Description |
---|---|
above |
Above Analysis |
below |
Below Analysis |
cross |
Cross Analysis |
crossover |
Crossover Analysis |
crossunder |
Crossunder Analysis |
falling |
Falling Analysis |
flipped |
Flipped Reading Analysis |
highest |
Highest Reading Analysis |
highestbar |
Highest Bar Offset Analysis |
lowest |
Lowest Reading Analysis |
lowestbar |
Lowest Bar Offset Analysis |
mean_falling |
Mean Falling Analysis |
mean_rising |
Mean Rising Analysis |
rising |
Rising Analysis |
value_range |
Value Range Analysis |
above
above(
candles: Indicator | Hexital | List[Candle],
indicator: str,
indicator_cmp: str,
length: int = 0,
index: int = -1,
) -> bool
Above Analysis
Checks whether the indicator
reading is higher than the indicator_cmp
reading.
By default, it evaluates the latest candle but can also check n
candles back.
If any candle within the specified range is above, it returns True
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The primary indicator to evaluate. |
required |
indicator_cmp
|
str
|
The secondary indicator to compare against. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 0 (only the current index). |
0
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Source code in hexital/analysis/movement.py
below
below(
candles: Indicator | Hexital | List[Candle],
indicator: str,
indicator_cmp: str,
length: int = 0,
index: int = -1,
) -> bool
Below Analysis
Checks whether the indicator
reading is lower than the indicator_cmp
reading.
By default, it evaluates the latest candle but can also check n
candles back.
If any candle within the specified range is below, it returns True
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The primary indicator to evaluate. |
required |
indicator_cmp
|
str
|
The secondary indicator to compare against. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 0 (only the current index). |
0
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Source code in hexital/analysis/movement.py
cross
cross(
candles: Indicator | Hexital | List[Candle],
indicator: str,
indicator_cmp: str,
length: int = 1,
index: int = -1,
) -> bool
Cross Analysis
Determines whether the indicator
reading has crossed the indicator_cmp
reading
within a specified range of candles. The cross can occur in either direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The primary indicator to evaluate. |
required |
indicator_cmp
|
str
|
The secondary indicator to compare against. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 1. (compares the latest with the previous). |
1
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Source code in hexital/analysis/movement.py
crossover
crossover(
candles: Indicator | Hexital | List[Candle],
indicator: str,
indicator_cmp: str,
length: int = 1,
index: int = -1,
) -> bool
Crossover Analysis
Determines whether the indicator
reading has crossed over the indicator_cmp
reading
within a specified range of candles. A crossover occurs when indicator
transitions from below
to above indicator_cmp
within the given range.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The primary indicator to evaluate. |
required |
indicator_cmp
|
str
|
The secondary indicator to compare against. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 1.
If |
1
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
bool
|
otherwise |
Source code in hexital/analysis/movement.py
crossunder
crossunder(
candles: Indicator | Hexital | List[Candle],
indicator: str,
indicator_cmp: str,
length: int = 1,
index: int = -1,
) -> bool
Crossunder Analysis
Determines whether the indicator
reading has crossed under the indicator_cmp
reading
within a specified range of candles. A crossunder occurs when indicator
transitions from above
to below indicator_cmp
within the given range.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The primary indicator to evaluate. |
required |
indicator_cmp
|
str
|
The secondary indicator to compare against. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 1.
If |
1
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
bool
|
otherwise |
Source code in hexital/analysis/movement.py
falling
falling(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 1,
index: int = -1,
) -> bool
Falling Analysis
Determines whether the indicator
consistently falling across a specified range of candles.
By default, it checks if the current indicator value is lower than the previous one.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 1. (compares the latest with the previous). |
1
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Source code in hexital/analysis/movement.py
flipped
flipped(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 1,
index: int = -1,
) -> bool
Flipped Reading Analysis
Determines whether the indicator
has "flipped" its value, meaning the current reading is different
from its previous reading, and within the last length
candles, the indicator was above its previous reading.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The indicator to evaluate. |
required |
length
|
int
|
The number of candles to check for a flip. Defaults to 1.
If |
1
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Source code in hexital/analysis/movement.py
highest
highest(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 4,
index: int = -1,
) -> float | None
Highest Reading Analysis
Determines the highest value of the specified indicator
over a given number of candles.
By default, includes the latest candle and evaluates up to the previous four candles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 4. |
4
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Type | Description |
---|---|
float | None
|
float | None: The highest reading for the specified |
float | None
|
or |
Source code in hexital/analysis/movement.py
highestbar
highestbar(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 4,
index: int = -1,
) -> int | None
Highest Bar Offset Analysis
Determines the offset (distance) to the candle with the highest reading of the specified indicator
within a given range. By default, includes the latest candle and evaluates up to the previous four candles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 4. |
4
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Type | Description |
---|---|
int | None
|
int | None: The offset to the candle with the highest reading, relative to the starting index, |
int | None
|
or |
Source code in hexital/analysis/movement.py
lowest
lowest(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 4,
index: int = -1,
) -> float | None
Lowest Reading Analysis
Determines the lowest value of the specified indicator
over a given number of candles.
By default, includes the latest candle and evaluates up to the previous four candles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 4. |
4
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Type | Description |
---|---|
float | None
|
float | None: The lowest reading for the specified |
float | None
|
or |
Source code in hexital/analysis/movement.py
lowestbar
lowestbar(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 4,
index: int = -1,
) -> int | None
Lowest Bar Offset Analysis
Determines the offset (distance) to the candle with the lowest reading of the specified indicator
within a given range. By default, includes the latest candle and evaluates up to the previous four candles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 4. |
4
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Type | Description |
---|---|
int | None
|
int | None: The offset to the candle with the lowest reading, relative to the starting index, |
int | None
|
or |
Source code in hexital/analysis/movement.py
mean_falling
mean_falling(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 4,
index: int = -1,
) -> bool
Mean Falling Analysis
Evaluates whether the indicator
is, on average, falling across a specified range of candles.
By default, it checks if the current indicator value is lower than the average of the previous four readings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 4. |
4
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Source code in hexital/analysis/movement.py
mean_rising
mean_rising(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 4,
index: int = -1,
) -> bool
Mean Rising Analysis
Evaluates whether the indicator
is, on average, rising across a specified range of candles.
By default, it checks if the current indicator value is higher than the average of the previous four readings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 4. |
4
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Source code in hexital/analysis/movement.py
rising
rising(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 1,
index: int = -1,
) -> bool
Rising Analysis
Determines whether the indicator
consistently rises across a specified range of candles.
By default, it checks if the current indicator value is greater than the previous one.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 1. (compares the latest with the previous). |
1
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
Source code in hexital/analysis/movement.py
value_range
value_range(
candles: Indicator | Hexital | List[Candle],
indicator: str,
length: int = 4,
index: int = -1,
) -> float | None
Value Range Analysis
Calculates the difference between the minimum and maximum values for the given indicator
within a specified range of candles. Includes the latest candle by default. If the specified
length exceeds the available candles, it will evaluate all candles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
candles
|
Indicator | Hexital | List[Candle]
|
The data source containing the indicators. |
required |
indicator
|
str
|
The name of the indicator to evaluate. |
required |
length
|
int
|
The number of candles to include in the range. Defaults to 4. |
4
|
index
|
int
|
The index to start the evaluation. Defaults to -1 (latest candle). |
-1
|
Returns:
Type | Description |
---|---|
float | None
|
float | None: The difference between the minimum and maximum indicator values in the range, |
float | None
|
or |