mdadash.backend.kernel.utils

Utils

Classes

EMATrend([short_window, long_window])

Exponential Moving Average (EMA) based Trend

class mdadash.backend.kernel.utils.EMATrend(short_window: int = 12, long_window: int = 26)[source]

Bases: object

Exponential Moving Average (EMA) based Trend

This utility class computes trend value based on short and long exponential moving averages based on the respective window sizes.

update(value: int | float) int[source]

Update current value and return trend

Parameters:

value (int | float) – The current value to update

Returns:

trend – Trend value as -1, 0 or 1

Return type:

int