py-alpha-lib 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/CHANGELOG.md +6 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/Cargo.lock +1 -1
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/Cargo.toml +1 -1
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/PKG-INFO +1 -1
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/context.py +43 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/.agent/skills/add_algo/SKILL.md +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/.github/workflows/CI.yml +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/.gitignore +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/.nwa-config.yaml +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/LICENSE +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/README.md +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/articles/001.md +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/articles/COMPARISON.md +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/benchmarks/benchmark_alpha101.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/benchmarks/benchmark_pandas.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/benchmarks/benchmark_polars_ta.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/build.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/gtja191/al/__init__.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/gtja191/al/alpha191.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/gtja191/al/alpha191_context.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/gtja191/alpha191.txt +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/gtja191/main.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/al/__init__.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/al/alpha101.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/al/alpha101_context.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/alpha101.txt +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/main.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/pd_/__init__.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/pd_/alpha101_adjusted.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/pl_/__init__.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/pl_/alpha101_adjusted.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/examples/wq101/result.md +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/pyproject.toml +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/__init__.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/algo/__init__.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/algo/algo.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/algo/algo_gen.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/algo.md +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/lang/__init__.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/lang/__main__.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/lang/alpha.lark +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/lang/parser.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/alpha/lang/to_python.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/conftest.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/tests/test_grammar.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/tests/test_rank.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/tests/test_talib.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/python/tests/test_to_python.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/rustfmt.toml +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/backfill.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/context.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/cross.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/ema.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/entropy.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/error.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/extremum.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/group.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/ma.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/misc.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/mod.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/moments.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/neutralize.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/quantile.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/rank.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/returns.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/scan.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/series.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/skip_nan_window.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/slope.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/stats.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/stddev.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/sum.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/algo/zscore.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/src/lib.rs +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/tests/rank.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/tests/usage.py +0 -0
- {py_alpha_lib-0.2.2 → py_alpha_lib-0.2.3}/tests/verify_sumif.py +0 -0
|
@@ -249,6 +249,9 @@ class ExecContext:
|
|
|
249
249
|
else:
|
|
250
250
|
return alpha.SMA(a, int(args[0]), int(args[1]))
|
|
251
251
|
|
|
252
|
+
def DMA(self, a: np.ndarray, weight: float) -> np.ndarray:
|
|
253
|
+
return alpha.DMA(a, float(weight))
|
|
254
|
+
|
|
252
255
|
# ── TS: Std Dev / Variance ─────────────────────────────────────────
|
|
253
256
|
# BRAIN: ts_std_dev GTJA: STD wq101: STDDEV
|
|
254
257
|
|
|
@@ -315,6 +318,11 @@ class ExecContext:
|
|
|
315
318
|
|
|
316
319
|
TSRANK = TS_RANK # gtja191
|
|
317
320
|
|
|
321
|
+
# ── TS: Quantile ────────────────────────────────────────────────────
|
|
322
|
+
|
|
323
|
+
def TS_QUANTILE(self, a: np.ndarray, w: int, q: float) -> np.ndarray:
|
|
324
|
+
return alpha.QUANTILE(a, int(w), q)
|
|
325
|
+
|
|
318
326
|
# ── TS: Delay / Delta ──────────────────────────────────────────────
|
|
319
327
|
# BRAIN: ts_delay, ts_delta
|
|
320
328
|
# wq101: DELAY, DELTA
|
|
@@ -364,6 +372,14 @@ class ExecContext:
|
|
|
364
372
|
|
|
365
373
|
REGRESI = TS_REGRESI # gtja191
|
|
366
374
|
|
|
375
|
+
# ── TS: Slope / Intercept ───────────────────────────────────────
|
|
376
|
+
|
|
377
|
+
def SLOPE(self, a: np.ndarray, w: int) -> np.ndarray:
|
|
378
|
+
return alpha.SLOPE(a, int(w))
|
|
379
|
+
|
|
380
|
+
def INTERCEPT(self, a: np.ndarray, w: int) -> np.ndarray:
|
|
381
|
+
return alpha.INTERCEPT(a, int(w))
|
|
382
|
+
|
|
367
383
|
# ── TS: Counting / Conditional ─────────────────────────────────────
|
|
368
384
|
# GTJA: COUNT, SUMIF
|
|
369
385
|
|
|
@@ -379,6 +395,17 @@ class ExecContext:
|
|
|
379
395
|
|
|
380
396
|
SUMIF = TS_SUMIF # gtja191
|
|
381
397
|
|
|
398
|
+
def SUMBARS(self, a: np.ndarray, amount: float) -> np.ndarray:
|
|
399
|
+
return alpha.SUMBARS(a, amount)
|
|
400
|
+
|
|
401
|
+
# ── TS: Bar Counting ──────────────────────────────────────────
|
|
402
|
+
|
|
403
|
+
def BARSLAST(self, cond: np.ndarray) -> np.ndarray:
|
|
404
|
+
return alpha.BARSLAST(np.asarray(cond, dtype=bool))
|
|
405
|
+
|
|
406
|
+
def BARSSINCE(self, cond: np.ndarray) -> np.ndarray:
|
|
407
|
+
return alpha.BARSSINCE(np.asarray(cond, dtype=bool))
|
|
408
|
+
|
|
382
409
|
# ── TS: Conditional Scan (SELF recursion) ───────────────────────────
|
|
383
410
|
# GTJA: SELF-referencing patterns
|
|
384
411
|
|
|
@@ -440,6 +467,16 @@ class ExecContext:
|
|
|
440
467
|
def TS_MOMENT(self, a: np.ndarray, w: int, k: int = 2) -> np.ndarray:
|
|
441
468
|
return alpha.MOMENT(a, int(w), int(k))
|
|
442
469
|
|
|
470
|
+
# ── TS: Binning ────────────────────────────────────────────────
|
|
471
|
+
|
|
472
|
+
def BINS(self, a: np.ndarray, n: int) -> np.ndarray:
|
|
473
|
+
return alpha.BINS(a, int(n))
|
|
474
|
+
|
|
475
|
+
# ── TS: Future Return ──────────────────────────────────────────
|
|
476
|
+
|
|
477
|
+
def FRET(self, open: np.ndarray, close: np.ndarray, is_calc: np.ndarray, delay: int, periods: int) -> np.ndarray:
|
|
478
|
+
return alpha.FRET(open, close, is_calc, int(delay), int(periods))
|
|
479
|
+
|
|
443
480
|
# ── TS: Cross Detection ────────────────────────────────────────────
|
|
444
481
|
# AmiBroker/GTJA: CROSS, LONGCROSS
|
|
445
482
|
|
|
@@ -449,6 +486,12 @@ class ExecContext:
|
|
|
449
486
|
def LONGCROSS(self, a: np.ndarray, b: np.ndarray, n: int) -> np.ndarray:
|
|
450
487
|
return alpha.LONGCROSS(a, b, int(n))
|
|
451
488
|
|
|
489
|
+
def RCROSS(self, a: np.ndarray, b: np.ndarray) -> np.ndarray:
|
|
490
|
+
return alpha.RCROSS(a, b)
|
|
491
|
+
|
|
492
|
+
def RLONGCROSS(self, a: np.ndarray, b: np.ndarray, n: int) -> np.ndarray:
|
|
493
|
+
return alpha.RLONGCROSS(a, b, int(n))
|
|
494
|
+
|
|
452
495
|
# ====================================================================
|
|
453
496
|
# Cross-Sectional Operators (no prefix)
|
|
454
497
|
#
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|