This commit is contained in:
Miha Kralj
2026-02-28 16:05:11 -08:00
parent 83e9511261
commit 768123d056
7 changed files with 307 additions and 150 deletions
Binary file not shown.
+3 -3
View File
@@ -160,7 +160,7 @@ HAS_DYMOI = _bind("qtl_dymoi", [_dp, _ci, _dp, _ci, _ci, _ci, _ci, _ci])
HAS_CRSI = _bind("qtl_crsi", [_dp, _ci, _dp, _ci, _ci, _ci]) # rsiP, streakP, rankP
HAS_BBB = _bind("qtl_bbb", [_dp, _ci, _dp, _ci, _cd]) # period, mult
HAS_BBI = _bind("qtl_bbi", [_dp, _ci, _dp, _ci, _ci, _ci, _ci]) # p1..p4
HAS_DEM = _bind("qtl_dem", _PD) # HL pattern
HAS_DEM = _bind("qtl_dem", [_dp, _dp, _ci, _dp, _ci]) # high,low,n,dst,period
HAS_BRAR = _bind("qtl_brar", [_dp, _dp, _dp, _dp, _ci, _dp, _dp, _ci]) # OHLC + 2 outputs + period
# ═══════════════════════════════════════════════════════════════════════════
@@ -173,7 +173,7 @@ HAS_TRIMA = _bind("qtl_trima", _PA)
HAS_SWMA = _bind("qtl_swma", _PA)
HAS_DWMA = _bind("qtl_dwma", _PA)
HAS_BLMA = _bind("qtl_blma", _PA)
HAS_ALMA = _bind("qtl_alma", _PA)
HAS_ALMA = _bind("qtl_alma", [_dp, _ci, _dp, _ci, _cd, _cd]) # period, offset, sigma
HAS_LSMA = _bind("qtl_lsma", _PA)
HAS_SGMA = _bind("qtl_sgma", _PA)
HAS_SINEMA = _bind("qtl_sinema", _PA)
@@ -223,7 +223,7 @@ HAS_BBWN = _bind("qtl_bbwn", [_dp, _ci, _dp, _ci, _cd, _ci]) # period,
HAS_BBWP = _bind("qtl_bbwp", [_dp, _ci, _dp, _ci, _cd, _ci]) # period, mult, lookback
HAS_STDDEV = _bind("qtl_stddev", _PA)
HAS_VARIANCE = _bind("qtl_variance", _PA)
HAS_ETHERM = _bind("qtl_etherm", _PD) # HL
HAS_ETHERM = _bind("qtl_etherm", [_dp, _dp, _ci, _dp, _ci]) # high,low,n,dst,period
HAS_CCV = _bind("qtl_ccv", [_dp, _ci, _dp, _ci, _ci]) # shortP, longP
HAS_CV = _bind("qtl_cv", [_dp, _ci, _dp, _ci, _cd, _cd]) # period, minVol, maxVol
HAS_CVI = _bind("qtl_cvi", [_dp, _ci, _dp, _ci, _ci]) # emaPeriod, rocPeriod
+21 -9
View File
@@ -213,7 +213,7 @@ def cfb(close: object, lengths: list[int] | None = None,
return _wrap(dst, idx, "CFB", "momentum", offset)
def asi(open: object, high: object, low: object, close: object,
limit: float = 0.0, offset: int = 0, **kwargs) -> object:
limit: float = 3.0, offset: int = 0, **kwargs) -> object:
"""Accumulative Swing Index."""
o, idx = _arr(open); h, _ = _arr(high); l, _ = _arr(low); c, _ = _arr(close)
n = len(o); dst = _out(n)
@@ -338,12 +338,14 @@ def bbi(close: object, p1: int = 3, p2: int = 6, p3: int = 12, p4: int = 24,
_check(_lib.qtl_bbi(_ptr(src), n, _ptr(dst), int(p1), int(p2), int(p3), int(p4)))
return _wrap(dst, idx, "BBI", "oscillator", offset)
def dem(high: object, low: object, offset: int = 0, **kwargs) -> object:
def dem(high: object, low: object, length: int = 14,
offset: int = 0, **kwargs) -> object:
"""DeMarker."""
length = int(length) if length is not None else 14
h, idx = _arr(high); l, _ = _arr(low)
n = len(h); dst = _out(n)
_check(_lib.qtl_dem(_ptr(h), _ptr(l), n, _ptr(dst)))
return _wrap(dst, idx, "DEM", "oscillator", int(offset) if offset is not None else 0)
_check(_lib.qtl_dem(_ptr(h), _ptr(l), n, _ptr(dst), length))
return _wrap(dst, idx, f"DEM_{length}", "oscillator", int(offset) if offset is not None else 0)
def brar(open: object, high: object, low: object, close: object,
length: int = 26, offset: int = 0, **kwargs) -> object:
@@ -391,9 +393,17 @@ def blma(close: object, length: int = 10, offset: int = 0, **kwargs) -> object:
"""Blackman Moving Average."""
return _pa("qtl_blma", close, length, offset, 10, "BLMA", "trend")
def alma(close: object, length: int = 10, offset: int = 0, **kwargs) -> object:
def alma(close: object, length: int = 10, offset: int = 0,
alma_offset: float = 0.85, sigma: float = 6.0, **kwargs) -> object:
"""Arnaud Legoux Moving Average."""
return _pa("qtl_alma", close, length, offset, 10, "ALMA", "trend")
length = int(length) if length is not None else 10
offset = int(offset) if offset is not None else 0
alma_offset = float(alma_offset) if alma_offset is not None else 0.85
sigma = float(sigma) if sigma is not None else 6.0
src, idx = _arr(close)
n = len(src); dst = _out(n)
_check(_lib.qtl_alma(_ptr(src), n, _ptr(dst), length, alma_offset, sigma))
return _wrap(dst, idx, f"ALMA_{length}", "trend", offset)
def lsma(close: object, length: int = 25, offset: int = 0, **kwargs) -> object:
"""Least Squares Moving Average."""
@@ -701,12 +711,14 @@ def variance(close: object, length: int = 20, offset: int = 0, **kwargs) -> obje
"""Variance."""
return _pa("qtl_variance", close, length, offset, 20, "VARIANCE", "volatility")
def etherm(high: object, low: object, offset: int = 0, **kwargs) -> object:
def etherm(high: object, low: object, length: int = 14,
offset: int = 0, **kwargs) -> object:
"""Elder Thermometer."""
length = int(length) if length is not None else 14
h, idx = _arr(high); l, _ = _arr(low)
n = len(h); dst = _out(n)
_check(_lib.qtl_etherm(_ptr(h), _ptr(l), n, _ptr(dst)))
return _wrap(dst, idx, "ETHERM", "volatility", int(offset) if offset is not None else 0)
_check(_lib.qtl_etherm(_ptr(h), _ptr(l), n, _ptr(dst), length))
return _wrap(dst, idx, f"ETHERM_{length}", "volatility", int(offset) if offset is not None else 0)
def ccv(close: object, short_period: int = 20, long_period: int = 1,
offset: int = 0, **kwargs) -> object: