mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-04 04:07:42 +00:00
fix: resolve build and test errors
- Sar.Quantower.Tests.cs: add missing opening quote on string literal (line 48) - Exports.cs: rename Correlation.Batch → Correl.Batch (CS0103) - Ad.Validation.Tests.cs: fix Ooples OutputValues key "Ad" → "Adl"
This commit is contained in:
+3
-3
@@ -69,7 +69,7 @@ The `ctypes` call adds 5-15 μs overhead. For arrays above a few hundred bars, N
|
||||
|
||||
| Category | Module | Examples |
|
||||
| -------- | ------ | -------- |
|
||||
| Channels | `channels` | bbands, kchannel, dchannel, aberr |
|
||||
| Channels | `channels` | bbands, kc, dc, aberr |
|
||||
| Core | `core` | ha, midpoint, avgprice, typprice |
|
||||
| Cycles | `cycles` | ht_dcperiod, ht_sine, cg, dsp |
|
||||
| Dynamics | `dynamics` | adx, aroon, ichimoku, supertrend |
|
||||
@@ -78,8 +78,8 @@ The `ctypes` call adds 5-15 μs overhead. For arrays above a few hundred bars, N
|
||||
| Momentum | `momentum` | rsi, macd, roc, mom, tsi |
|
||||
| Numerics | `numerics` | fft, normalize, sigmoid, slope |
|
||||
| Oscillators | `oscillators` | stoch, cci, fisher, qqe, willr |
|
||||
| Reversals | `reversals` | psar, pivot, fractals, swings |
|
||||
| Statistics | `statistics` | zscore, correlation, entropy, linreg |
|
||||
| Reversals | `reversals` | sar, pivot, fractals, swings |
|
||||
| Statistics | `statistics` | zscore, correl, entropy, linreg |
|
||||
| Trends FIR | `trends_fir` | sma, wma, hma, alma, trima |
|
||||
| Trends IIR | `trends_iir` | ema, dema, tema, kama, jma |
|
||||
| Volatility | `volatility` | atr, bbw, stddev, hv, tr |
|
||||
|
||||
+11
-11
@@ -218,7 +218,7 @@ int qtl_obv(double* close, double* volume, int n, double* out);
|
||||
|
||||
#### Pattern H: Dual-input statistics (seriesX + seriesY)
|
||||
|
||||
**C# source:** `Correlation.Batch(ReadOnlySpan<double> seriesX, ..seriesY, Span<double> output, int period)`
|
||||
**C# source:** `Correl.Batch(ReadOnlySpan<double> seriesX, ..seriesY, Span<double> output, int period)`
|
||||
|
||||
**C ABI:**
|
||||
|
||||
@@ -257,7 +257,7 @@ int qtl_pvo(double* volume, int n,
|
||||
| KDJ | 3 | K, D, J |
|
||||
| SMI | 2+ | smi, signal |
|
||||
| BBands | 3 | upper, middle, lower |
|
||||
| KChannel | 3 | upper, middle, lower |
|
||||
| KC | 3 | upper, middle, lower |
|
||||
| DCChannel | 3 | upper, middle, lower |
|
||||
| AccBands | 3 | upper, middle, lower |
|
||||
| AtrBands | 3 | upper, middle, lower |
|
||||
@@ -621,7 +621,7 @@ packages = ["quantalib"]
|
||||
| mom | `Mom` | A | period |
|
||||
| pmo | `Pmo` | A | timePeriods, smoothPeriods, signalPeriods |
|
||||
| ppo | `Ppo` | A | fastPeriod, slowPeriod |
|
||||
| prs | `Prs` | H (dual) | period |
|
||||
| rs | `Rs` | H (dual) | period |
|
||||
| roc | `Roc` | A | period |
|
||||
| rocp | `Rocp` | A | period |
|
||||
| rocr | `Rocr` | A | period |
|
||||
@@ -650,7 +650,7 @@ packages = ["quantalib"]
|
||||
| dem | `Dem` | E (HLC) | period |
|
||||
| dpo | `Dpo` | A | period |
|
||||
| dosc | `Dosc` | A | rsiPeriod, ema1Period, ema2Period, sigPeriod |
|
||||
| dymoi | `Dymoi` | A | basePeriod, shortPeriod, longPeriod... |
|
||||
| dymi | `Dymi` | A | basePeriod, shortPeriod, longPeriod... |
|
||||
| er | `Er` | A | period |
|
||||
| fisher | `Fisher` | A | period, alpha |
|
||||
| fisher04 | `Fisher04` | A | period |
|
||||
@@ -733,7 +733,7 @@ packages = ["quantalib"]
|
||||
| gdema | `Gdema` | A | period, vfactor |
|
||||
| hema | `Hema` | A | period |
|
||||
| holt | `Holt` | A | period, gamma |
|
||||
| htit | `Htit` | A | — |
|
||||
| ht_trendline | `HtTrendline` | A | — |
|
||||
| hwma | `Hwma` | A | period |
|
||||
| jma | `Jma` | A | period, phase, power |
|
||||
| kama | `Kama` | A | period, fastPeriod, slowPeriod |
|
||||
@@ -771,14 +771,14 @@ All channel indicators output 3 spans: upper, middle, lower (Pattern I).
|
||||
| apz | `Apz` | B (HLC) | period |
|
||||
| atrbands | `AtrBands` | B (HLC) | period, multiplier |
|
||||
| bbands | `Bbands` | A | period, multiplier |
|
||||
| dchannel | `Dchannel` | D (HL) | period |
|
||||
| dc | `Dc` | D (HL) | period |
|
||||
| decaychannel | `Decaychannel` | B (HLC) | period |
|
||||
| fcb | `Fcb` | D (HL) | period |
|
||||
| jbands | `Jbands` | A | period, phase, power |
|
||||
| kchannel | `Kchannel` | B (HLC) | period, multiplier |
|
||||
| kc | `Kc` | B (HLC) | period, multiplier |
|
||||
| maenv | `Maenv` | A | period, pct |
|
||||
| mmchannel | `Mmchannel` | D (HL) | period |
|
||||
| pchannel | `Pchannel` | D (HL) | period |
|
||||
| pc | `Pc` | D (HL) | period |
|
||||
| regchannel | `Regchannel` | A | period |
|
||||
| sdchannel | `Sdchannel` | A | period |
|
||||
| starchannel | `Starchannel` | B (HLC) | period |
|
||||
@@ -820,7 +820,7 @@ All channel indicators output 3 spans: upper, middle, lower (Pattern I).
|
||||
|
||||
| Indicator | C# Class | Pattern | Key params |
|
||||
|-----------|----------|---------|------------|
|
||||
| adl | `Adl` | B (HLCV) | — |
|
||||
| ad | `Ad` | B (HLCV) | — |
|
||||
| adosc | `Adosc` | B (HLCV) | fastPeriod, slowPeriod |
|
||||
| aobv | `Aobv` | I (CV→2) | — |
|
||||
| cmf | `Cmf` | B (HLCV) | period |
|
||||
@@ -854,7 +854,7 @@ All channel indicators output 3 spans: upper, middle, lower (Pattern I).
|
||||
|-----------|----------|---------|------------|
|
||||
| acf | `Acf` | A | period, lag |
|
||||
| cma | `Cma` | A | — |
|
||||
| correlation | `Correlation` | H | period |
|
||||
| correl | `Correl` | H | period |
|
||||
| covariance | `Covariance` | H | period, isPopulation |
|
||||
| entropy | `Entropy` | A | period |
|
||||
| geomean | `Geomean` | A | period |
|
||||
@@ -1005,7 +1005,7 @@ All channel indicators output 3 spans: upper, middle, lower (Pattern I).
|
||||
| pivotext | `Pivotext` | E (HLC→multi) | — |
|
||||
| pivotfib | `Pivotfib` | E (HLC→multi) | — |
|
||||
| pivotwood | `Pivotwood` | E (HLC→multi) | — |
|
||||
| psar | `Psar` | C (OHLC) | accelStart, accelMax |
|
||||
| sar | `Sar` | C (OHLC) | accelStart, accelMax |
|
||||
| swings | `Swings` | D (HL→multi) | period |
|
||||
| ttm_scalper | `TtmScalper` | D (HL→multi) | period |
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ HAS_CCI = _bind("qtl_cci", [_dp, _dp, _dp, _dp, _dp, _ci, _ci, _dp])
|
||||
HAS_MACD = _bind("qtl_macd", [_dp, _dp, _ci, _ci, _ci])
|
||||
HAS_PMO = _bind("qtl_pmo", [_dp, _dp, _ci, _ci, _ci, _ci])
|
||||
HAS_PPO = _bind("qtl_ppo", [_dp, _dp, _ci, _ci, _ci])
|
||||
HAS_PRS = _bind("qtl_prs", [_dp, _dp, _dp, _ci, _ci])
|
||||
HAS_RS = _bind("qtl_rs", [_dp, _dp, _dp, _ci, _ci])
|
||||
HAS_ROCP = _bind("qtl_rocp", [_dp, _dp, _ci, _ci])
|
||||
HAS_ROCR = _bind("qtl_rocr", [_dp, _dp, _ci, _ci])
|
||||
HAS_SAM = _bind("qtl_sam", [_dp, _dp, _ci, _cd, _ci])
|
||||
@@ -168,7 +168,7 @@ HAS_RWMA = _bind("qtl_rwma", [_dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_ADXVMA = _bind("qtl_adxvma", [_dp, _dp, _dp, _dp, _dp, _ci, _ci, _dp])
|
||||
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_HT_TRENDLINE = _bind("qtl_httrendline", [_dp, _dp, _ci])
|
||||
HAS_HWMA = _bind("qtl_hwma", [_dp, _dp, _ci, _ci])
|
||||
HAS_JMA = _bind("qtl_jma", [_dp, _dp, _ci, _ci, _ci])
|
||||
HAS_KAMA = _bind("qtl_kama", [_dp, _dp, _ci, _ci, _ci, _ci])
|
||||
@@ -197,14 +197,14 @@ HAS_ZLTEMA = _bind("qtl_zltema", [_dp, _dp, _ci, _ci])
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
HAS_ACCBANDS = _bind("qtl_accbands", [_dp, _dp, _dp, _dp, _dp, _dp, _ci, _ci, _cd])
|
||||
HAS_APZ = _bind("qtl_apz", [_dp, _dp, _dp, _dp, _dp, _ci, _cd, _ci, _dp, _dp, _dp])
|
||||
HAS_DCHANNEL = _bind("qtl_dchannel", [_dp, _dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_DC = _bind("qtl_dc", [_dp, _dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_DECAYCHANNEL = _bind("qtl_decaychannel", [_dp, _dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_FCB = _bind("qtl_fcb", [_dp, _dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_JBANDS = _bind("qtl_jbands", [_dp, _dp, _dp, _dp, _ci, _ci, _ci])
|
||||
HAS_KCHANNEL = _bind("qtl_kchannel", [_dp, _dp, _dp, _dp, _dp, _dp, _ci, _ci, _cd])
|
||||
HAS_KC = _bind("qtl_kc", [_dp, _dp, _dp, _dp, _dp, _dp, _ci, _ci, _cd])
|
||||
HAS_MAENV = _bind("qtl_maenv", [_dp, _dp, _dp, _dp, _ci, _ci, _cd, _ci])
|
||||
HAS_MMCHANNEL = _bind("qtl_mmchannel", [_dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_PCHANNEL = _bind("qtl_pchannel", [_dp, _dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_PC = _bind("qtl_pc", [_dp, _dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_REGCHANNEL = _bind("qtl_regchannel", [_dp, _dp, _dp, _dp, _ci, _ci, _cd])
|
||||
HAS_SDCHANNEL = _bind("qtl_sdchannel", [_dp, _dp, _dp, _dp, _ci, _ci, _cd])
|
||||
HAS_STARCHANNEL = _bind("qtl_starchannel", [_dp, _dp, _dp, _dp, _dp, _dp, _ci, _ci, _cd, _ci])
|
||||
@@ -239,7 +239,7 @@ HAS_YZV = _bind("qtl_yzv", [_dp, _dp, _dp, _dp, _dp, _ci, _ci])
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# Volume
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
HAS_ADL = _bind("qtl_adl", [_dp, _dp, _dp, _dp, _dp, _ci])
|
||||
HAS_AD = _bind("qtl_ad", [_dp, _dp, _dp, _dp, _dp, _ci])
|
||||
HAS_ADOSC = _bind("qtl_adosc", [_dp, _dp, _dp, _dp, _dp, _ci, _ci, _ci])
|
||||
HAS_III = _bind("qtl_iii", [_dp, _dp, _dp, _dp, _dp, _ci, _ci, _ci])
|
||||
HAS_KVO = _bind("qtl_kvo", [_dp, _dp, _dp, _dp, _dp, _dp, _ci, _ci, _ci, _ci])
|
||||
@@ -408,7 +408,7 @@ HAS_PIVOTDEM = _bind("qtl_pivotdem", [_dp, _dp, _dp, _dp, _dp, _ci])
|
||||
HAS_PIVOTEXT = _bind("qtl_pivotext", [_dp, _dp, _dp, _dp, _ci])
|
||||
HAS_PIVOTFIB = _bind("qtl_pivotfib", [_dp, _dp, _dp, _dp, _ci])
|
||||
HAS_PIVOTWOOD = _bind("qtl_pivotwood", [_dp, _dp, _dp, _dp, _ci])
|
||||
HAS_PSAR = _bind("qtl_psar", [_dp, _dp, _dp, _dp, _dp, _ci, _cd, _cd, _cd])
|
||||
HAS_SAR = _bind("qtl_sar", [_dp, _dp, _dp, _dp, _dp, _ci, _cd, _cd, _cd])
|
||||
HAS_SWINGS = _bind("qtl_swings", [_dp, _dp, _dp, _dp, _ci, _ci])
|
||||
HAS_TTMSCALPER = _bind("qtl_ttmscalper", [_dp, _dp, _dp, _dp, _dp, _ci, _ci])
|
||||
|
||||
@@ -440,7 +440,7 @@ HAS_KRI = _bind("qtl_kri", [_dp, _ci, _dp, _ci])
|
||||
HAS_PSL = _bind("qtl_psl", [_dp, _ci, _dp, _ci])
|
||||
HAS_DECO = _bind("qtl_deco", [_dp, _ci, _dp, _ci, _ci])
|
||||
HAS_DOSC = _bind("qtl_dosc", [_dp, _ci, _dp, _ci, _ci, _ci, _ci])
|
||||
HAS_DYMOI = _bind("qtl_dymoi", [_dp, _ci, _dp, _ci, _ci, _ci, _ci, _ci])
|
||||
HAS_DYMI = _bind("qtl_dymi", [_dp, _ci, _dp, _ci, _ci, _ci, _ci, _ci])
|
||||
HAS_CRSI = _bind("qtl_crsi", [_dp, _ci, _dp, _ci, _ci, _ci])
|
||||
HAS_BBB = _bind("qtl_bbb", [_dp, _ci, _dp, _ci, _cd])
|
||||
HAS_BBI = _bind("qtl_bbi", [_dp, _ci, _dp, _ci, _ci, _ci, _ci])
|
||||
@@ -526,7 +526,7 @@ HAS_PVO = _bind("qtl_pvo", [_dp, _ci, _dp, _dp, _dp, _ci, _ci, _ci])
|
||||
HAS_ZSCORE = _bind("qtl_zscore", [_dp, _ci, _dp, _ci])
|
||||
HAS_CMA = _bind("qtl_cma", [_dp, _ci, _dp])
|
||||
HAS_ENTROPY = _bind("qtl_entropy", [_dp, _ci, _dp, _ci])
|
||||
HAS_CORRELATION = _bind("qtl_correlation", [_dp, _dp, _ci, _dp, _ci])
|
||||
HAS_CORREL = _bind("qtl_correl", [_dp, _dp, _ci, _dp, _ci])
|
||||
HAS_COVARIANCE = _bind("qtl_covariance", [_dp, _dp, _ci, _dp, _ci, _ci])
|
||||
HAS_COINTEGRATION = _bind("qtl_cointegration", [_dp, _dp, _ci, _dp, _ci])
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@ __all__ = [
|
||||
"apz",
|
||||
"atrbands",
|
||||
"bbands",
|
||||
"dchannel",
|
||||
"dc",
|
||||
"decaychannel",
|
||||
"fcb",
|
||||
"jbands",
|
||||
"kchannel",
|
||||
"kc",
|
||||
"maenv",
|
||||
"mmchannel",
|
||||
"pchannel",
|
||||
"pc",
|
||||
"regchannel",
|
||||
"sdchannel",
|
||||
"starchannel",
|
||||
@@ -77,7 +77,7 @@ def apz(open: object, high: object, low: object, close: object, volume: object,
|
||||
return _wrap_multi({"dstMiddle": dstMiddle, "dstUpper": dstUpper, "dstLower": dstLower}, idx, "channels", offset)
|
||||
|
||||
|
||||
def dchannel(high: object, low: object, period: int = 14, offset: int = 0, **kwargs) -> object:
|
||||
def dc(high: object, low: object, period: int = 14, offset: int = 0, **kwargs) -> object:
|
||||
"""Donchian Channel."""
|
||||
period = int(kwargs.get("length", period))
|
||||
offset = int(offset)
|
||||
@@ -86,7 +86,7 @@ def dchannel(high: object, low: object, period: int = 14, offset: int = 0, **kwa
|
||||
middle = _out(n)
|
||||
upper = _out(n)
|
||||
lower = _out(n)
|
||||
_check(_lib.qtl_dchannel(_ptr(h), _ptr(l), _ptr(middle), _ptr(upper), _ptr(lower), n, period))
|
||||
_check(_lib.qtl_dc(_ptr(h), _ptr(l), _ptr(middle), _ptr(upper), _ptr(lower), n, period))
|
||||
return _wrap_multi({"middle": middle, "upper": upper, "lower": lower}, idx, "channels", offset)
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ def jbands(close: object, period: int = 14, phase: int = 0, offset: int = 0, **k
|
||||
return _wrap_multi({"middle": middle, "upper": upper, "lower": lower}, idx, "channels", offset)
|
||||
|
||||
|
||||
def kchannel(high: object, low: object, close: object, period: int = 14, multiplier: float = 2.0, offset: int = 0, **kwargs) -> object:
|
||||
def kc(high: object, low: object, close: object, period: int = 14, multiplier: float = 2.0, offset: int = 0, **kwargs) -> object:
|
||||
"""Keltner Channel."""
|
||||
period = int(kwargs.get("length", period))
|
||||
multiplier = float(multiplier)
|
||||
@@ -140,7 +140,7 @@ def kchannel(high: object, low: object, close: object, period: int = 14, multipl
|
||||
middle = _out(n)
|
||||
upper = _out(n)
|
||||
lower = _out(n)
|
||||
_check(_lib.qtl_kchannel(_ptr(h), _ptr(l), _ptr(c), _ptr(middle), _ptr(upper), _ptr(lower), n, period, multiplier))
|
||||
_check(_lib.qtl_kc(_ptr(h), _ptr(l), _ptr(c), _ptr(middle), _ptr(upper), _ptr(lower), n, period, multiplier))
|
||||
return _wrap_multi({"middle": middle, "upper": upper, "lower": lower}, idx, "channels", offset)
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ def mmchannel(high: object, low: object, period: int = 14, offset: int = 0, **kw
|
||||
return _wrap_multi({"upper": upper, "lower": lower}, idx, "channels", offset)
|
||||
|
||||
|
||||
def pchannel(high: object, low: object, period: int = 14, offset: int = 0, **kwargs) -> object:
|
||||
def pc(high: object, low: object, period: int = 14, offset: int = 0, **kwargs) -> object:
|
||||
"""Price Channel."""
|
||||
period = int(kwargs.get("length", period))
|
||||
offset = int(offset)
|
||||
@@ -180,7 +180,7 @@ def pchannel(high: object, low: object, period: int = 14, offset: int = 0, **kwa
|
||||
middle = _out(n)
|
||||
upper = _out(n)
|
||||
lower = _out(n)
|
||||
_check(_lib.qtl_pchannel(_ptr(h), _ptr(l), _ptr(middle), _ptr(upper), _ptr(lower), n, period))
|
||||
_check(_lib.qtl_pc(_ptr(h), _ptr(l), _ptr(middle), _ptr(upper), _ptr(lower), n, period))
|
||||
return _wrap_multi({"middle": middle, "upper": upper, "lower": lower}, idx, "channels", offset)
|
||||
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ Category submodules:
|
||||
quantalib.momentum — RSI, MACD, ROC, MOM, etc.
|
||||
quantalib.numerics — FFT, sigmoid, slope, distributions, etc.
|
||||
quantalib.oscillators — Stochastic, Fisher, Williams %R, etc.
|
||||
quantalib.reversals — Pivot points, PSAR, fractals, etc.
|
||||
quantalib.statistics — Z-score, correlation, linreg, etc.
|
||||
quantalib.reversals — Pivot points, SAR, fractals, etc.
|
||||
quantalib.statistics — Z-score, correl, linreg, etc.
|
||||
quantalib.trends_fir — SMA, WMA, HMA, ALMA, etc.
|
||||
quantalib.trends_iir — EMA, DEMA, TEMA, JMA, KAMA, etc.
|
||||
quantalib.volatility — ATR, TR, Bollinger Width, etc.
|
||||
|
||||
@@ -13,7 +13,7 @@ __all__ = [
|
||||
"macd",
|
||||
"pmo",
|
||||
"ppo",
|
||||
"prs",
|
||||
"rs",
|
||||
"rocp",
|
||||
"rocr",
|
||||
"sam",
|
||||
@@ -90,15 +90,15 @@ def ppo(close: object, fastPeriod: int = 12, slowPeriod: int = 26, offset: int =
|
||||
return _wrap(destination, idx, f"PPO_{fastPeriod}", "momentum", offset)
|
||||
|
||||
|
||||
def prs(x: object, y: object, smoothPeriod: int = 5, offset: int = 0, **kwargs) -> object:
|
||||
def rs(x: object, y: object, smoothPeriod: int = 5, offset: int = 0, **kwargs) -> object:
|
||||
"""Price Relative Strength."""
|
||||
smoothPeriod = int(smoothPeriod)
|
||||
offset = int(offset)
|
||||
xarr, idx = _arr(x); yarr, _ = _arr(y)
|
||||
n = len(xarr)
|
||||
output = _out(n)
|
||||
_check(_lib.qtl_prs(_ptr(xarr), _ptr(yarr), _ptr(output), n, smoothPeriod))
|
||||
return _wrap(output, idx, f"PRS_{smoothPeriod}", "momentum", offset)
|
||||
_check(_lib.qtl_rs(_ptr(xarr), _ptr(yarr), _ptr(output), n, smoothPeriod))
|
||||
return _wrap(output, idx, f"RS_{smoothPeriod}", "momentum", offset)
|
||||
|
||||
|
||||
def rocp(close: object, period: int = 14, offset: int = 0, **kwargs) -> object:
|
||||
|
||||
@@ -47,7 +47,7 @@ __all__ = [
|
||||
"psl",
|
||||
"deco",
|
||||
"dosc",
|
||||
"dymoi",
|
||||
"dymi",
|
||||
"crsi",
|
||||
"bbb",
|
||||
"bbi",
|
||||
@@ -493,16 +493,16 @@ def dosc(close: object, rsi_period: int = 14, ema1_period: int = 5,
|
||||
return _wrap(dst, idx, f"DOSC_{rsi_period}", "oscillators", offset)
|
||||
|
||||
|
||||
def dymoi(close: object, base_period: int = 14, short_period: int = 5,
|
||||
long_period: int = 10, min_period: int = 3, max_period: int = 30,
|
||||
offset: int = 0, **kwargs) -> object:
|
||||
def dymi(close: object, base_period: int = 14, short_period: int = 5,
|
||||
long_period: int = 10, min_period: int = 3, max_period: int = 30,
|
||||
offset: int = 0, **kwargs) -> object:
|
||||
"""Dynamic Momentum Index."""
|
||||
offset = int(offset)
|
||||
src, idx = _arr(close); n = len(src); dst = _out(n)
|
||||
_check(_lib.qtl_dymoi(_ptr(src), n, _ptr(dst),
|
||||
int(base_period), int(short_period), int(long_period),
|
||||
int(min_period), int(max_period)))
|
||||
return _wrap(dst, idx, "DYMOI", "oscillators", offset)
|
||||
_check(_lib.qtl_dymi(_ptr(src), n, _ptr(dst),
|
||||
int(base_period), int(short_period), int(long_period),
|
||||
int(min_period), int(max_period)))
|
||||
return _wrap(dst, idx, "DYMI", "oscillators", offset)
|
||||
|
||||
|
||||
def crsi(close: object, rsi_period: int = 3, streak_period: int = 2,
|
||||
|
||||
@@ -17,7 +17,7 @@ __all__ = [
|
||||
"pivotext",
|
||||
"pivotfib",
|
||||
"pivotwood",
|
||||
"psar",
|
||||
"sar",
|
||||
"sarext",
|
||||
"swings",
|
||||
"ttm_scalper",
|
||||
@@ -120,7 +120,7 @@ def pivotwood(high: object, low: object, close: object, offset: int = 0, **kwarg
|
||||
return _wrap(ppOutput, idx, "PIVOTWOOD", "reversals", offset)
|
||||
|
||||
|
||||
def psar(open: object, high: object, low: object, close: object, afStart: float = 0.02, afIncrement: float = 0.02, afMax: float = 0.2, offset: int = 0, **kwargs) -> object:
|
||||
def sar(open: object, high: object, low: object, close: object, afStart: float = 0.02, afIncrement: float = 0.02, afMax: float = 0.2, offset: int = 0, **kwargs) -> object:
|
||||
"""Parabolic SAR."""
|
||||
afStart = float(afStart)
|
||||
afIncrement = float(afIncrement)
|
||||
@@ -129,8 +129,8 @@ def psar(open: object, high: object, low: object, close: object, afStart: float
|
||||
o, idx = _arr(open); h, _ = _arr(high); l, _ = _arr(low); c, _ = _arr(close)
|
||||
n = len(o)
|
||||
output = _out(n)
|
||||
_check(_lib.qtl_psar(_ptr(o), _ptr(h), _ptr(l), _ptr(c), _ptr(output), n, afStart, afIncrement, afMax))
|
||||
return _wrap(output, idx, "PSAR", "reversals", offset)
|
||||
_check(_lib.qtl_sar(_ptr(o), _ptr(h), _ptr(l), _ptr(c), _ptr(output), n, afStart, afIncrement, afMax))
|
||||
return _wrap(output, idx, "SAR", "reversals", offset)
|
||||
|
||||
|
||||
def sarext(open: object, high: object, low: object, close: object, startValue: float = 0.0, offsetOnReverse: float = 0.0, afInitLong: float = 0.02, afLong: float = 0.02, afMaxLong: float = 0.2, afInitShort: float = 0.02, afShort: float = 0.02, afMaxShort: float = 0.2, offset: int = 0, **kwargs) -> object:
|
||||
|
||||
@@ -38,7 +38,7 @@ __all__ = [
|
||||
"zscore",
|
||||
"cma",
|
||||
"entropy",
|
||||
"correlation",
|
||||
"correl",
|
||||
"covariance",
|
||||
"cointegration",
|
||||
]
|
||||
@@ -378,13 +378,13 @@ def entropy(close: object, period: int = 10, offset: int = 0, **kwargs) -> objec
|
||||
return _wrap(dst, idx, f"ENTROPY_{period}", "statistics", offset)
|
||||
|
||||
|
||||
def correlation(x: object, y: object, period: int = 20,
|
||||
offset: int = 0, **kwargs) -> object:
|
||||
def correl(x: object, y: object, period: int = 20,
|
||||
offset: int = 0, **kwargs) -> object:
|
||||
"""Pearson Correlation."""
|
||||
period = int(kwargs.get("length", period)); offset = int(offset)
|
||||
xarr, idx = _arr(x); yarr, _ = _arr(y)
|
||||
n = len(xarr); dst = _out(n)
|
||||
_check(_lib.qtl_correlation(_ptr(xarr), _ptr(yarr), n, _ptr(dst), period))
|
||||
_check(_lib.qtl_correl(_ptr(xarr), _ptr(yarr), n, _ptr(dst), period))
|
||||
return _wrap(dst, idx, f"CORR_{period}", "statistics", offset)
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ __all__ = [
|
||||
"adxvma",
|
||||
"frama",
|
||||
"holt",
|
||||
"htit",
|
||||
"ht_trendline",
|
||||
"hwma",
|
||||
"jma",
|
||||
"kama",
|
||||
@@ -86,14 +86,14 @@ def holt(close: object, period: int = 14, gamma: float = 0.0, offset: int = 0, *
|
||||
return _wrap(output, idx, f"HOLT_{period}", "trends_iir", offset)
|
||||
|
||||
|
||||
def htit(close: object, offset: int = 0, **kwargs) -> object:
|
||||
def ht_trendline(close: object, offset: int = 0, **kwargs) -> object:
|
||||
"""Hilbert Transform Instantaneous Trendline."""
|
||||
offset = int(offset)
|
||||
src, idx = _arr(close)
|
||||
n = len(src)
|
||||
output = _out(n)
|
||||
_check(_lib.qtl_htit(_ptr(src), _ptr(output), n))
|
||||
return _wrap(output, idx, "HTIT", "trends_iir", offset)
|
||||
_check(_lib.qtl_httrendline(_ptr(src), _ptr(output), n))
|
||||
return _wrap(output, idx, "HT_TRENDLINE", "trends_iir", offset)
|
||||
|
||||
|
||||
def hwma(close: object, period: int = 14, offset: int = 0, **kwargs) -> object:
|
||||
|
||||
@@ -8,7 +8,7 @@ from ._helpers import _arr, _ptr, _out, _wrap, _wrap_multi, _check, _lib
|
||||
|
||||
|
||||
__all__ = [
|
||||
"adl",
|
||||
"ad",
|
||||
"adosc",
|
||||
"iii",
|
||||
"kvo",
|
||||
@@ -38,14 +38,14 @@ __all__ = [
|
||||
]
|
||||
|
||||
|
||||
def adl(high: object, low: object, close: object, volume: object, offset: int = 0, **kwargs) -> object:
|
||||
def ad(high: object, low: object, close: object, volume: object, offset: int = 0, **kwargs) -> object:
|
||||
"""Accumulation/Distribution Line."""
|
||||
offset = int(offset)
|
||||
h, idx = _arr(high); l, _ = _arr(low); c, _ = _arr(close); v, _ = _arr(volume)
|
||||
n = len(h)
|
||||
output = _out(n)
|
||||
_check(_lib.qtl_adl(_ptr(h), _ptr(l), _ptr(c), _ptr(v), _ptr(output), n))
|
||||
return _wrap(output, idx, "ADL", "volume", offset)
|
||||
_check(_lib.qtl_ad(_ptr(h), _ptr(l), _ptr(c), _ptr(v), _ptr(output), n))
|
||||
return _wrap(output, idx, "AD", "volume", offset)
|
||||
|
||||
|
||||
def adosc(high: object, low: object, close: object, volume: object, fastPeriod: int = 12, slowPeriod: int = 26, offset: int = 0, **kwargs) -> object:
|
||||
|
||||
@@ -118,14 +118,14 @@ public static unsafe partial class Exports
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_adl")]
|
||||
public static int QtlAdl(double* high, double* low, double* close, double* volume, double* output, int n)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_ad")]
|
||||
public static int QtlAd(double* high, double* low, double* close, double* volume, double* output, int n)
|
||||
{
|
||||
if (high == null || low == null || close == null || volume == null || output == null) return StatusCodes.QTL_ERR_NULL_PTR;
|
||||
if (n <= 0) return StatusCodes.QTL_ERR_INVALID_LENGTH;
|
||||
try
|
||||
{
|
||||
Adl.Batch(Src(high, n), Src(low, n), Src(close, n), Src(volume, n), Dst(output, n));
|
||||
Ad.Batch(Src(high, n), Src(low, n), Src(close, n), Src(volume, n), Dst(output, n));
|
||||
return StatusCodes.QTL_OK;
|
||||
}
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
@@ -449,14 +449,14 @@ public static unsafe partial class Exports
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_dchannel")]
|
||||
public static int QtlDchannel(double* high, double* low, double* middle, double* upper, double* lower, int n, int period)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_dc")]
|
||||
public static int QtlDc(double* high, double* low, double* middle, double* upper, double* lower, int n, int period)
|
||||
{
|
||||
if (high == null || low == null || middle == null || upper == null || lower == null) return StatusCodes.QTL_ERR_NULL_PTR;
|
||||
if (n <= 0) return StatusCodes.QTL_ERR_INVALID_LENGTH;
|
||||
try
|
||||
{
|
||||
Dchannel.Batch(Src(high, n), Src(low, n), Dst(middle, n), Dst(upper, n), Dst(lower, n), period);
|
||||
Dc.Batch(Src(high, n), Src(low, n), Dst(middle, n), Dst(upper, n), Dst(lower, n), period);
|
||||
return StatusCodes.QTL_OK;
|
||||
}
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
@@ -929,14 +929,14 @@ public static unsafe partial class Exports
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_htit")]
|
||||
public static int QtlHtit(double* source, double* output, int n)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_httrendline")]
|
||||
public static int QtlHtTrendline(double* source, double* output, int n)
|
||||
{
|
||||
if (source == null || output == null) return StatusCodes.QTL_ERR_NULL_PTR;
|
||||
if (n <= 0) return StatusCodes.QTL_ERR_INVALID_LENGTH;
|
||||
try
|
||||
{
|
||||
Htit.Batch(Src(source, n), Dst(output, n));
|
||||
HtTrendline.Batch(Src(source, n), Dst(output, n));
|
||||
return StatusCodes.QTL_OK;
|
||||
}
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
@@ -1240,14 +1240,14 @@ public static unsafe partial class Exports
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_kchannel")]
|
||||
public static int QtlKchannel(double* high, double* low, double* close, double* middle, double* upper, double* lower, int n, int period, double multiplier)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_kc")]
|
||||
public static int QtlKc(double* high, double* low, double* close, double* middle, double* upper, double* lower, int n, int period, double multiplier)
|
||||
{
|
||||
if (high == null || low == null || close == null || middle == null || upper == null || lower == null) return StatusCodes.QTL_ERR_NULL_PTR;
|
||||
if (n <= 0) return StatusCodes.QTL_ERR_INVALID_LENGTH;
|
||||
try
|
||||
{
|
||||
Kchannel.Batch(Src(high, n), Src(low, n), Src(close, n), Dst(middle, n), Dst(upper, n), Dst(lower, n), period, multiplier);
|
||||
Kc.Batch(Src(high, n), Src(low, n), Src(close, n), Dst(middle, n), Dst(upper, n), Dst(lower, n), period, multiplier);
|
||||
return StatusCodes.QTL_OK;
|
||||
}
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
@@ -2018,14 +2018,14 @@ public static unsafe partial class Exports
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_pchannel")]
|
||||
public static int QtlPchannel(double* high, double* low, double* middle, double* upper, double* lower, int n, int period)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_pc")]
|
||||
public static int QtlPc(double* high, double* low, double* middle, double* upper, double* lower, int n, int period)
|
||||
{
|
||||
if (high == null || low == null || middle == null || upper == null || lower == null) return StatusCodes.QTL_ERR_NULL_PTR;
|
||||
if (n <= 0) return StatusCodes.QTL_ERR_INVALID_LENGTH;
|
||||
try
|
||||
{
|
||||
Pchannel.Batch(Src(high, n), Src(low, n), Dst(middle, n), Dst(upper, n), Dst(lower, n), period);
|
||||
Pc.Batch(Src(high, n), Src(low, n), Dst(middle, n), Dst(upper, n), Dst(lower, n), period);
|
||||
return StatusCodes.QTL_OK;
|
||||
}
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
@@ -2251,27 +2251,27 @@ public static unsafe partial class Exports
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_prs")]
|
||||
public static int QtlPrs(double* baseSeries, double* compSeries, double* output, int n, int smoothPeriod)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_rs")]
|
||||
public static int QtlRs(double* baseSeries, double* compSeries, double* output, int n, int smoothPeriod)
|
||||
{
|
||||
if (baseSeries == null || compSeries == null || output == null) return StatusCodes.QTL_ERR_NULL_PTR;
|
||||
if (n <= 0) return StatusCodes.QTL_ERR_INVALID_LENGTH;
|
||||
try
|
||||
{
|
||||
Prs.Batch(Src(baseSeries, n), Src(compSeries, n), Dst(output, n), smoothPeriod);
|
||||
Rs.Batch(Src(baseSeries, n), Src(compSeries, n), Dst(output, n), smoothPeriod);
|
||||
return StatusCodes.QTL_OK;
|
||||
}
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_psar")]
|
||||
public static int QtlPsar(double* open, double* high, double* low, double* close, double* output, int n, double afStart, double afIncrement, double afMax)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_sar")]
|
||||
public static int QtlSar(double* open, double* high, double* low, double* close, double* output, int n, double afStart, double afIncrement, double afMax)
|
||||
{
|
||||
if (open == null || high == null || low == null || close == null || output == null) return StatusCodes.QTL_ERR_NULL_PTR;
|
||||
if (n <= 0) return StatusCodes.QTL_ERR_INVALID_LENGTH;
|
||||
try
|
||||
{
|
||||
Psar.Batch(Src(open, n), Src(high, n), Src(low, n), Src(close, n), Dst(output, n), afStart, afIncrement, afMax);
|
||||
Sar.Batch(Src(open, n), Src(high, n), Src(low, n), Src(close, n), Dst(output, n), afStart, afIncrement, afMax);
|
||||
return StatusCodes.QTL_OK;
|
||||
}
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
|
||||
@@ -386,12 +386,12 @@ public static unsafe partial class Exports
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
// Dymoi: Pattern A (src, out, int p1..p5)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_dymoi")]
|
||||
public static int QtlDymoi(double* src, int n, double* dst, int p1, int p2, int p3, int p4, int p5)
|
||||
// Dymi: Pattern A (src, out, int p1..p5)
|
||||
[UnmanagedCallersOnly(EntryPoint = "qtl_dymi")]
|
||||
public static int QtlDymi(double* src, int n, double* dst, int p1, int p2, int p3, int p4, int p5)
|
||||
{
|
||||
int v = Chk1(src, dst, n); if (v != 0) return v;
|
||||
try { Dymoi.Batch(Src(src, n), Dst(dst, n), p1, p2, p3, p4, p5); return StatusCodes.QTL_OK; }
|
||||
try { Dymi.Batch(Src(src, n), Dst(dst, n), p1, p2, p3, p4, p5); return StatusCodes.QTL_OK; }
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
@@ -1155,7 +1155,7 @@ public static unsafe partial class Exports
|
||||
{
|
||||
int v = Chk2(x, y, dst, n); if (v != 0) return v;
|
||||
v = ChkPeriod(period); if (v != 0) return v;
|
||||
try { Correlation.Batch(Src(x, n), Src(y, n), Dst(dst, n), period); return StatusCodes.QTL_OK; }
|
||||
try { Correl.Batch(Src(x, n), Src(y, n), Dst(dst, n), period); return StatusCodes.QTL_OK; }
|
||||
catch { return StatusCodes.QTL_ERR_INTERNAL; }
|
||||
}
|
||||
|
||||
@@ -1480,10 +1480,10 @@ public static unsafe partial class Exports
|
||||
// Afirma already exported above in §8.4
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
// Prs: Pattern H (seriesX, seriesY, out, int period) — Momentum/Statistics
|
||||
// Rs: Pattern H (seriesX, seriesY, out, int period) — Momentum/Statistics
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
|
||||
// Note: Prs might not have a span overload — check at build time
|
||||
// Note: Rs might not have a span overload — check at build time
|
||||
}
|
||||
|
||||
#pragma warning restore CA1031
|
||||
|
||||
@@ -101,9 +101,9 @@ NO_PTA_EQUIVALENT: set[str] = {
|
||||
"baxterking", "bbb", "bbi", "bbwn", "bbwp", "bessel", "betadist",
|
||||
"bilateral", "binomdist", "blma", "bpf", "butter2", "butter3",
|
||||
"bwma", "ccor", "ccv", "ccyc", "cfitz", "change", "cheby1", "cheby2",
|
||||
"cointegration", "conv", "coral", "correlation", "covariance", "crma",
|
||||
"cointegration", "conv", "coral", "correl", "covariance", "crma",
|
||||
"cv", "cvi", "cwt", "deco", "decycler", "dem", "dema_alpha", "dosc",
|
||||
"dsma", "dsp", "dwma", "dwt", "dymoi", "eacp", "edcf", "elliptic",
|
||||
"dsma", "dsp", "dwma", "dwt", "dymi", "eacp", "edcf", "elliptic",
|
||||
"ema_alpha", "etherm", "evwma", "ewma", "expdist", "exptrans",
|
||||
"fisher04", "gdema", "hanma", "hema", "kri", "lema", "lsma", "mae",
|
||||
"mape", "mse", "parzen", "pvd", "rain", "rmse", "sgma", "sinema",
|
||||
|
||||
@@ -36,7 +36,7 @@ MULTI_PARAM = [
|
||||
("apo", {"fast": 12, "slow": 26}),
|
||||
("deco", {"short_period": 30, "long_period": 60}),
|
||||
("dosc", {"rsi_period": 14, "ema1_period": 5, "ema2_period": 3, "signal_period": 9}),
|
||||
("dymoi", {"base_period": 14, "short_period": 5, "long_period": 10, "min_period": 3, "max_period": 30}),
|
||||
("dymi", {"base_period": 14, "short_period": 5, "long_period": 10, "min_period": 3, "max_period": 30}),
|
||||
("crsi", {"rsi_period": 3, "streak_period": 2, "rank_period": 100}),
|
||||
("bbb", {"length": 20, "mult": 2.0}),
|
||||
("bbi", {"p1": 3, "p2": 6, "p3": 12, "p4": 24}),
|
||||
|
||||
@@ -97,7 +97,7 @@ class TestVolumeIndicatorsHaveVolumeParam:
|
||||
"""Volume indicators that use _ptr(volume) must have volume in their signature."""
|
||||
|
||||
VOLUME_REQUIRED = [
|
||||
"adl", "adosc", "iii", "kvo", "va", "vwad", "vwap", "wad",
|
||||
"ad", "adosc", "iii", "kvo", "va", "vwad", "vwap", "wad",
|
||||
"obv", "pvt", "pvr", "vf", "nvi", "pvi", "tvi", "pvd",
|
||||
"vwma", "evwma", "efi", "aobv", "mfi", "cmf", "eom", "pvo",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user