mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-07 21:47:43 +00:00
feat: add 8 new indicators with full integration
New indicators: - HWC (Holt-Winters Channel) — channels, 27 tests - VWMACD (Volume-Weighted MACD) — momentum, 38 tests - Squeeze Pro — oscillators, 69 tests - BW_MFI (Bill Williams MFI) — oscillators - DSTOCH (Double Stochastic) — oscillators - ATRSTOP (ATR Trailing Stop) — reversals - VSTOP (Volatility Stop) — reversals - Convexity (Beta Convexity) — statistics, 23 tests Integration: - Python bridge: Exports.cs, _bridge.py, wrapper modules - Documentation: _sidebar.md, _index.md pages, SPEC.md - All analyzer warnings fixed (MA0074, xUnit2013, S2699) Build: 0 warnings, 0 errors | Tests: 15,933 passed, 0 failed
This commit is contained in:
@@ -8,6 +8,7 @@ from ._helpers import _arr, _ptr, _out, _wrap, _wrap_multi, _check, _lib
|
||||
|
||||
|
||||
__all__ = [
|
||||
"atrstop",
|
||||
"chandelier",
|
||||
"ckstop",
|
||||
"fractals",
|
||||
@@ -21,9 +22,22 @@ __all__ = [
|
||||
"sarext",
|
||||
"swings",
|
||||
"ttm_scalper",
|
||||
"vstop",
|
||||
]
|
||||
|
||||
|
||||
def atrstop(high: object, low: object, close: object, period: int = 21, multiplier: float = 3.0, offset: int = 0, **kwargs) -> object:
|
||||
"""ATR Trailing Stop."""
|
||||
period = int(kwargs.get("length", period))
|
||||
multiplier = float(multiplier)
|
||||
offset = int(offset)
|
||||
h, idx = _arr(high); l, _ = _arr(low); c, _ = _arr(close)
|
||||
n = len(h)
|
||||
output = _out(n)
|
||||
_check(_lib.qtl_atrstop(_ptr(h), _ptr(l), _ptr(c), _ptr(output), n, period, multiplier))
|
||||
return _wrap(output, idx, f"ATRSTOP_{period}", "reversals", offset)
|
||||
|
||||
|
||||
def chandelier(open: object, high: object, low: object, close: object, period: int = 14, multiplier: float = 2.0, offset: int = 0, **kwargs) -> object:
|
||||
"""Chandelier Exit."""
|
||||
period = int(kwargs.get("length", period))
|
||||
@@ -173,3 +187,15 @@ def ttm_scalper(high: object, low: object, close: object, useCloses: int = 0, of
|
||||
lowOutput = _out(n)
|
||||
_check(_lib.qtl_ttmscalper(_ptr(h), _ptr(l), _ptr(c), _ptr(highOutput), _ptr(lowOutput), n, useCloses))
|
||||
return _wrap_multi({"highOutput": highOutput, "lowOutput": lowOutput}, idx, "reversals", offset)
|
||||
|
||||
|
||||
def vstop(high: object, low: object, close: object, period: int = 7, multiplier: float = 3.0, offset: int = 0, **kwargs) -> object:
|
||||
"""Volatility Stop."""
|
||||
period = int(kwargs.get("length", period))
|
||||
multiplier = float(multiplier)
|
||||
offset = int(offset)
|
||||
h, idx = _arr(high); l, _ = _arr(low); c, _ = _arr(close)
|
||||
n = len(h)
|
||||
output = _out(n)
|
||||
_check(_lib.qtl_vstop(_ptr(h), _ptr(l), _ptr(c), _ptr(output), n, period, multiplier))
|
||||
return _wrap(output, idx, f"VSTOP_{period}", "reversals", offset)
|
||||
|
||||
Reference in New Issue
Block a user