diff --git a/python/quantalib/_bridge.py b/python/quantalib/_bridge.py index 33c3a7bf..42c6bcba 100644 --- a/python/quantalib/_bridge.py +++ b/python/quantalib/_bridge.py @@ -166,7 +166,7 @@ HAS_RWMA = _bind("qtl_rwma", [_dp, _dp, _dp, _dp, _ci, _ci]) # Trends — IIR # ═══════════════════════════════════════════════════════════════════════════ HAS_ADXVMA = _bind("qtl_adxvma", [_dp, _dp, _dp, _dp, _dp, _ci, _ci, _dp]) -HAS_FRAMA = _bind("qtl_frama", [_dp, _dp, _ci, _ci]) +HAS_FRAMA = _bind("qtl_frama", [_dp, _dp, _dp, _ci, _ci]) HAS_HOLT = _bind("qtl_holt", [_dp, _dp, _ci, _ci, _cd]) HAS_HTIT = _bind("qtl_htit", [_dp, _dp, _ci]) HAS_HWMA = _bind("qtl_hwma", [_dp, _dp, _ci, _ci]) diff --git a/python/quantalib/trends_iir.py b/python/quantalib/trends_iir.py index 89b76309..69eb665c 100644 --- a/python/quantalib/trends_iir.py +++ b/python/quantalib/trends_iir.py @@ -63,14 +63,14 @@ def adxvma(open: object, high: object, low: object, close: object, volume: objec return _wrap(dst, idx, f"ADXVMA_{period}", "trends_iir", offset) -def frama(close: object, period: int = 14, offset: int = 0, **kwargs) -> object: +def frama(high: object, low: object, period: int = 14, offset: int = 0, **kwargs) -> object: """Fractal Adaptive Moving Average.""" period = int(kwargs.get("length", period)) offset = int(offset) - src, idx = _arr(close) - n = len(src) + h, idx = _arr(high); l, _ = _arr(low) + n = len(h) output = _out(n) - _check(_lib.qtl_frama(_ptr(src), _ptr(output), n, period)) + _check(_lib.qtl_frama(_ptr(h), _ptr(l), _ptr(output), n, period)) return _wrap(output, idx, f"FRAMA_{period}", "trends_iir", offset) diff --git a/python/src/Exports.Generated.cs b/python/src/Exports.Generated.cs index accd3928..1db853ce 100644 --- a/python/src/Exports.Generated.cs +++ b/python/src/Exports.Generated.cs @@ -575,13 +575,13 @@ public static unsafe partial class Exports } [UnmanagedCallersOnly(EntryPoint = "qtl_frama")] - public static int QtlFrama(double* source, double* output, int n, int period) + public static int QtlFrama(double* high, double* low, double* output, int n, int period) { - if (source == null || output == null) return StatusCodes.QTL_ERR_NULL_PTR; + if (high == null || low == null || output == null) return StatusCodes.QTL_ERR_NULL_PTR; if (n <= 0) return StatusCodes.QTL_ERR_INVALID_LENGTH; try { - Frama.Batch(Src(source, n), Dst(output, n), period); + Frama.Batch(Src(high, n), Src(low, n), period, Dst(output, n)); return StatusCodes.QTL_OK; } catch { return StatusCodes.QTL_ERR_INTERNAL; }