docs: add license rationale, Python/PineScript guides, API updates

- Add docs/license.md with Apache 2.0 rationale and patent protection analysis
- Add docs/python.md and docs/pinescript.md platform guides
- Expand README license section with disclosure and link to rationale
- Update docs/api.md and docs/architecture.md
- Update Python bindings: helpers, all indicator modules, pyproject.toml
- Add Python tests for Arrow and Polars integration
- Update TValue core type and documentation
- Add fix_length_to_period tooling script
This commit is contained in:
Miha Kralj
2026-03-03 22:11:35 -08:00
parent 6f4e083811
commit f10baa6dfb
28 changed files with 2050 additions and 542 deletions
+12 -12
View File
@@ -108,29 +108,29 @@ def ssfdsp(close: object, period: int = 14, offset: int = 0, **kwargs) -> object
_check(_lib.qtl_ssfdsp(_ptr(src), _ptr(output), n, period))
return _wrap(output, idx, f"SSFDSP_{period}", "cycles", offset)
def cg(close: object, length: int = 10, offset: int = 0, **kwargs) -> object:
def cg(close: object, period: int = 10, offset: int = 0, **kwargs) -> object:
"""Center of Gravity."""
length = int(length); offset = int(offset)
period = int(kwargs.get("length", period)); offset = int(offset)
src, idx = _arr(close); n = len(src); dst = _out(n)
_check(_lib.qtl_cg(_ptr(src), n, _ptr(dst), length))
return _wrap(dst, idx, f"CG_{length}", "cycles", offset)
_check(_lib.qtl_cg(_ptr(src), n, _ptr(dst), period))
return _wrap(dst, idx, f"CG_{period}", "cycles", offset)
def dsp(close: object, length: int = 20, offset: int = 0, **kwargs) -> object:
def dsp(close: object, period: int = 20, offset: int = 0, **kwargs) -> object:
"""Dominant Cycle Period (DSP)."""
length = int(length); offset = int(offset)
period = int(kwargs.get("length", period)); offset = int(offset)
src, idx = _arr(close); n = len(src); dst = _out(n)
_check(_lib.qtl_dsp(_ptr(src), n, _ptr(dst), length))
return _wrap(dst, idx, f"DSP_{length}", "cycles", offset)
_check(_lib.qtl_dsp(_ptr(src), n, _ptr(dst), period))
return _wrap(dst, idx, f"DSP_{period}", "cycles", offset)
def ccor(close: object, length: int = 20, alpha: float = 0.07,
def ccor(close: object, period: int = 20, alpha: float = 0.07,
offset: int = 0, **kwargs) -> object:
"""Circular Correlation."""
length = int(length); offset = int(offset)
period = int(kwargs.get("length", period)); offset = int(offset)
src, idx = _arr(close); n = len(src); dst = _out(n)
_check(_lib.qtl_ccor(_ptr(src), n, _ptr(dst), length, float(alpha)))
return _wrap(dst, idx, f"CCOR_{length}", "cycles", offset)
_check(_lib.qtl_ccor(_ptr(src), n, _ptr(dst), period, float(alpha)))
return _wrap(dst, idx, f"CCOR_{period}", "cycles", offset)
def ebsw(close: object, hp_length: int = 40, ssf_length: int = 10,