jma
jma
Classes:
Name | Description |
---|---|
JMA |
Jurik Moving Average Average - JMA |
JMA
dataclass
JMA(
*,
candles: List[Candle] = list(),
name: str = "",
timeframe: Optional[str | TimeFrame | timedelta | int] = None,
timeframe_fill: bool = False,
candle_life: Optional[timedelta] = None,
candlestick: Optional[CandlestickType | str] = None,
rounding: Optional[int] = 4,
period: int = 7,
source: str = "close",
phase: float = 0.0
)
Bases: Indicator
Jurik Moving Average Average - JMA
The JMA is an adaptive moving average that aims to reduce lag and improve responsiveness to price changes compared to traditional moving averages. By incorporating volatility and phase shift components, the JMA seeks to provide traders with a more accurate and timely representation of market trends.
Sources
https://c.mql5.com/forextsd/forum/164/jurik_1.pdf
Parameters:
Name | Type | Description | Default |
---|---|---|---|
period
|
int
|
How many Periods to use. Defaults to 7 |
7
|
source
|
str
|
Which input field to calculate the Indicator. Defaults to "close" |
'close'
|
phase
|
float
|
How heavy/light the average is [-100, 100]. Defaults to 0.0 |
0.0
|
Methods:
Name | Description |
---|---|
add_managed_indicator |
Adds managed sub indicator, this will not auto calculate with indicator |
add_sub_indicator |
Adds sub indicator, this will auto calculate with indicator |
as_list |
Retrieve the indicator values for all candles as a list. |
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 |
purge |
Remove this indicator value from all Candles |
read_candle |
Simple method to get an indicator reading from a candle, |
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 |
Attributes:
Name | Type | Description |
---|---|---|
candle_manager |
CandleManager
|
The Candle Manager which controls TimeFrame, Trimming and collapsing |
has_reading |
bool
|
Check if the indicator has generated values in the candles. |
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
has_reading
property
has_reading: bool
Check if the indicator has generated values in the candles.
This property determines whether the indicator readings have been generated for the associated candle data.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
|
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_managed_indicator
Adds managed sub indicator, this will not auto calculate with indicator
Source code in hexital/core/indicator.py
add_sub_indicator
Adds sub indicator, this will auto calculate with indicator
Source code in hexital/core/indicator.py
as_list
Retrieve the indicator values for all 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
|
Optional[str]
|
The name of the indicator to retrieve.
Defaults to |
None
|
Returns:
Type | Description |
---|---|
List[float | dict | None]
|
List[float | dict | None]: A list containing the indicator values for
each candle. The values may be floats,
dictionaries (for complex indicators),
or |
Source code in hexital/core/indicator.py
calculate
Calculate the TA values, will calculate for all the Candles, where this indicator is missing
Source code in hexital/core/indicator.py
calculate_index
Calculate the TA values, will calculate a index range the Candles, will re-calculate
Source code in hexital/core/indicator.py
purge
Remove this indicator value from all Candles
Source code in hexital/core/indicator.py
read_candle
read_candle(
candle: Candle, name: Optional[str] = None, default: Optional[T] = None
) -> float | dict | None | T
Simple method to get an indicator reading from a candle, regardless of it's location
Source code in hexital/core/indicator.py
reading
reading(
name: Optional[str] = None,
index: Optional[int] = None,
default: Optional[T] = None,
) -> float | dict | None | T
Simple method to get an indicator reading from the index Name can use '.' to find nested reading, E.G 'MACD_12_26_9.MACD
Source code in hexital/core/indicator.py
reading_count
Returns how many instance of the given indicator exist
Source code in hexital/core/indicator.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