Commit Graph

177 Commits

Author SHA1 Message Date
Miha Kralj 8937b0c0fa fix: CI checkout auth + Wrmse test failure
- Publish.yml: Change workflow permissions from {} to contents:read
  to fix GITHUB_TOKEN having no scopes for actions/checkout@v4
- Wrmse.cs: Use DateTime.UtcNow instead of DateTime.MinValue in
  Update(double,double,double) to match Beta/Covariance pattern
- Bump version to 0.8.5
2026-03-11 20:54:16 -07:00
Miha Kralj b9783f7c03 docs: sweep all indicator references — fix paths, add missing entries, sort alphabetically
_sidebar.md:
- Fix 4 wrong DI/DM paths (minus_di→minusdi, minus_dm→minusdm, plus_di→plusdi, plus_dm→plusdm)
- Sort Dynamics section alphabetically
- Add DECAY and EDECAY to Numerics section

lib/dynamics/_index.md:
- Fix HT_TRENDMODE link (Httrendmode.md→HtTrendmode.md)
- Sort all 25 indicators alphabetically

lib/core/_index.md:
- Sort all 8 indicators alphabetically (HA was out of order)

docs/indicators.md:
- FIR: Replace with all 33 entries sorted
- IIR: Replace with all 36 entries sorted
- Filters: Add SAK (now 37 entries)
- Oscillators: Add 17 missing (BBI, BRAR, COPPOCK, CRSI, CTI, DOSC, ER, ERI, FI, KRI, KST, MSTOCH, PSL, QQE, RVGI, SQUEEZE, TD_SEQ) — now 48 entries
- Dynamics: Sort all 25 entries alphabetically
- Statistics: Add POLYFIT, TRIM, WAVG, WINS — now 35 entries sorted
- Numerics: Add FFT, IFFT — now 31 entries sorted
- Core: Add HA — now 8 entries sorted

Total: 402 indicators across 16 categories, all cross-referenced.
2026-03-11 20:36:36 -07:00
Miha Kralj 33d20f2a18 feat(dynamics): add PlusDI, MinusDI, PlusDM, MinusDM indicators
Complete thin Dx-composition wrapper indicators with full test coverage:

- PlusDi/MinusDi: Directional Indicator wrappers (DiPlus/DiMinus from Dx)
- PlusDm/MinusDm: Directional Movement wrappers (DmPlus/DmMinus from Dx)
- Individual validation tests per indicator directory (TALib, Skender, bounds)
- Combined unit tests (DiDm.Tests.cs) and validation tests (DiDm.Validation.Tests.cs)
- Quantower wrappers + tests for all 4 indicators
- PineScript v6 implementations with compensated RMA
- Normalized .md documentation for all indicators and categories
- 182 tests passing, 0 failures
2026-03-11 20:21:52 -07:00
Miha Kralj 19f956521d docs: add PineScript links to all indicator .md files, docsify .pine renderer with comprehensive Prism v6 syntax highlighting
- Added PineScript row to property tables in 375 .md files linking to companion .pine files
- Docsify plugin intercepts .pine link clicks, fetches and renders content as syntax-highlighted code blocks
- Comprehensive Prism.languages.pine grammar covering 18 token categories: annotations, types, qualifiers, namespaces, OHLCV builtins, functions, keywords, operators
- Custom CSS tokens using GitHub dark palette for Pine-specific visual differentiation
2026-03-11 15:36:23 -07:00
codefactor-io 567fa89465 [CodeFactor] Apply fixes to commit 4a01f03 2026-03-11 03:35:12 +00:00
Miha Kralj 4a01f03cb4 Merge branch 'dev' 2026-03-10 20:34:18 -07:00
Miha Kralj 7ec79538aa refactor: move Decay/Edecay from trends_IIR to numerics; update filter signatures
- Move lib/trends_IIR/decay/ → lib/numerics/decay/
- Move lib/trends_IIR/edecay/ → lib/numerics/edecay/
- Update Category in Decay.md/Edecay.md from Trends (IIR) to Numerics
- Add DECAY/EDECAY entries to lib/numerics/_index.md and docs/indicators.md
- Update filter signature .md files and .svg assets
- Update trends_IIR signature docs (htit, mama, holt, etc.)
- All 163 tests passing, 0 warnings, 0 errors
2026-03-10 20:33:55 -07:00
Miha Kralj 35a6702b06 fix(docs): correct .md documentation across errors, dynamics, filters, forecasts, momentum, numerics, oscillators, reversals, statistics, trends, volatility, volume
Deep review of all indicator categories verified .md headers against .cs WarmupPeriod, parameters, inputs, and outputs. Fixes include warmup corrections, parameter documentation, output type accuracy, and Pine Script alignment.
2026-03-10 18:38:23 -07:00
Miha Kralj 8906c62dcf fix(docs): correct warmup values in cycles/channels .md files
Cycles:
- ebsw: warmup 1 bar → Math.Max(hpLength, ssfLength) + 3 (default 43)
- homod: warmup 1 bar → maxPeriod * 2 (default 100)

Channels:
- apchannel: warmup 1 bar → ⌈3/alpha⌉ (default 15); params None → alpha; outputs Single → Multiple
- jbands: warmup 1 bar → ⌈20 + 80 × period^0.36⌉
- uchannel: warmup 1 bar → Math.Max(strPeriod, centerPeriod)"
2026-03-10 18:37:19 -07:00
Miha Kralj 031f1b5fe6 feat: add new indicators (Decay, Edecay, MinusDi, MinusDm, PlusDi, PlusDm, Maxindex, Minindex, Sarext) and update pine scripts, core libs, validation tests, and python bindings 2026-03-09 13:45:46 -07:00
Miha Kralj f192b6d014 merge: bump version to 0.8.4 2026-03-04 08:50:31 -08:00
Miha Kralj 4f22062f78 chore: bump version to 0.8.4 2026-03-04 08:50:29 -08:00
Miha Kralj 6ae79525f6 merge: dev into main - license docs, Python/PineScript guides, API updates 2026-03-03 22:12:25 -08:00
Miha Kralj f10baa6dfb 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
2026-03-03 22:11:35 -08:00
codefactor-io 5957ef065c [CodeFactor] Apply fixes to commit 7737098 2026-03-03 20:43:16 +00:00
Miha Kralj 7737098a54 fix: suppress MA0077 on ref struct types and fix variable shadowing
ref struct types (BatchOutputs, BatchInputs, ScalarState, WorkBuffers)
cannot implement IEquatable<T> — C# prohibits interface implementation
on ref structs. Added #pragma warning disable/restore MA0077 at type
declaration level in AccBands.cs, Aberr.cs, Apz.cs (9 ref structs).

Renamed local 'output' to 'result' in Wma.Coverage.Tests.cs to avoid
shadowing the primary constructor ITestOutputHelper parameter (S1117/MA0084).
2026-03-03 12:42:42 -08:00
Miha Kralj 3e858ca39e chore: bump version to 0.8.2 2026-03-03 10:37:45 -08:00
Miha Kralj 50711933e1 chore: remove gitignored files from tracking, update channels
- Remove .vscode/, __pycache__/, publish binaries, and .dll/.pdb files from git tracking (now covered by .gitignore)
2026-03-03 10:33:23 -08:00
Miha Kralj 1910fdca93 chore: repo cleanup and code quality improvements
- Remove global.json (SDK pinning unnecessary)

- Remove nuget.config, move MyGet source to .csproj RestoreAdditionalProjectSources

- Gitignore ndepend/ entirely, move badges to docs/img/

- Update README.md and docs/ndepend.md badge paths

- Add NDepend project property to QuanTAlib.slnx

- Expand .editorconfig ReSharper/diagnostic suppressions

- Use ArgumentOutOfRangeException instead of ArgumentException

- Use discard _ for unused event sender parameters

- Remove quantalib.code-workspace and sonar-suppressions.json

- Add filter signature SVGs
2026-03-03 09:22:55 -08:00
Miha Kralj e1a6743bda fix: add .md extension to signature links in indicator docs 2026-03-03 08:45:25 -08:00
Miha Kralj d6c8dea98b docs: audit and fix all category _index.md files 2026-03-03 08:33:20 -08:00
Miha Kralj 751d9ff041 fix: Aberr tests expect ArgumentOutOfRangeException to match actual throws 2026-03-02 18:07:09 -08:00
Miha Kralj fbdc9172cc fix(nlma): restore original Igorad cycle zone numerator (i-phase+1)
The cycle zone t parameter must use (i-phase+1) per original MQL4 NonLagMA v7.1.

Using (i-phase) eliminated the intentional discontinuity at the phase/cycle boundary, producing incorrect kernel weights visible in the signature SVG.
2026-03-02 15:03:38 -08:00
Miha Kralj f0f9382817 docs: add SVG signature wrapper .md pages, fix docsify links, minimize content margins 2026-03-02 14:55:34 -08:00
Miha Kralj ae7207c3d8 test: add Jma_Period_AffectsResult verifying period changes output across all modes 2026-03-02 09:11:48 -08:00
Miha Kralj fa77882be7 refactor: remove unused JMA power parameter from entire stack 2026-03-01 22:14:30 -08:00
Miha Kralj ce4416d388 fix(python): critical bug fixes across Python wrapper 2026-03-01 21:35:19 -08:00
Miha Kralj 07054ae20a refactor: centralize versioning and stabilize PMA validation 2026-03-01 14:07:14 -08:00
Miha Kralj 83e9511261 python wrapper 2026-02-28 14:14:35 -08:00
Miha Kralj 82e0248eb0 test: refine robustness test to be more agnostic 2026-02-27 12:57:22 -08:00
Miha Kralj 769a923a24 test: setup common stability and robustness properties tracking 2026-02-27 12:50:05 -08:00
Miha Kralj 4ab3a7fb53 doc headers 2026-02-27 07:48:12 -08:00
Miha Kralj 8a1ba95173 validation and profiles 2026-02-26 22:02:52 -08:00
Miha Kralj 9ab37c1200 adding missing validations 2026-02-26 09:59:44 -08:00
Miha Kralj 467a8c1cef filters update 2026-02-23 17:27:35 -08:00
Miha Kralj 7253f61299 Add TRAMA implementation and comprehensive tests
- Implemented the TRAMA (Trend Regularity Adaptive Moving Average) class with adaptive EMA logic.
- Added unit tests for TRAMA functionality, including constructor validation, basic calculations, state management, and robustness checks.
- Created validation tests to ensure consistency across different modes of operation (streaming, batch, and static calculations).
- Enhanced documentation for TRAMA, including performance profiles and quality metrics.
- Updated workspace configuration by removing unnecessary folder references.
2026-02-21 20:45:38 -08:00
Miha Kralj 90d5638008 Add new moving average implementations: LTMA, MCNMA, NLMA, NMA, NYQMA, RAIN, and TRAMA
- LTMA (Linear Trend Moving Average): Introduces a predictive moving average using dual cascaded EMAs for trend estimation.
- MCNMA (McNicholl EMA): Implements a zero-lag TEMA using a cascaded EMA structure for enhanced responsiveness.
- NLMA (Non-Lag Moving Average): Utilizes a damped cosine kernel to achieve reduced lag in moving averages.
- NMA (Natural Moving Average): Adapts smoothing based on volatility profiles using a square-root kernel.
- NYQMA (Nyquist Moving Average): Applies the Nyquist-Shannon theorem to prevent aliasing in cascaded moving averages.
- RAIN (Rainbow Moving Average): Combines multiple SMA layers with weighted averages for multi-scale smoothing.
- TRAMA (Trend Regularity Adaptive Moving Average): Adapts smoothing based on the frequency of new highs and lows in price data.
2026-02-20 21:40:32 -08:00
Miha Kralj cbeefc9d64 Remove multiple Pine Script indicators: SSFDSP, STARCHANNEL, STBANDS, STC, UBANDS, UCHANNEL, VWAPBANDS, and VWAPSD. These indicators were deleted to streamline the library and remove unused or redundant code. 2026-02-20 18:44:56 -08:00
Miha Kralj 3dd05f23e4 Refactor indicators to include "Ehlers" in names and descriptions for clarity
- Updated the name and description of the Hilbert Trendline (HTIT) to "Ehlers Hilbert Transform Instantaneous Trend (HTIT)".
- Changed the name and description of the MESA Adaptive Moving Average (MAMA) to "Ehlers MESA Adaptive Moving Average".
- Modified the Center of Gravity (CG) indicator to "Ehlers Center of Gravity (CG)".
- Renamed the Detrended Synthetic Price (DSP) to "Ehlers Detrended Synthetic Price (DSP)".
- Updated the Autocorrelation Periodogram (EACP) to "Ehlers Autocorrelation Periodogram (EACP)".
- Changed the Homodyne Discriminator (HOMOD) to "Ehlers Homodyne Discriminator (HOMOD)".
- Updated the Hilbert Transform Dominant Cycle Period and Phase indicators to include "Ehlers" in their names.
- Renamed the Hilbert Transform Phasor Components to "Ehlers Hilbert Transform Phasor Components (HT_PHASOR)".
- Updated the SineWave indicator to "Ehlers Hilbert Transform SineWave (HT_SINE)".
- Changed the Phasor Analysis indicator to "Ehlers Hilbert Transform Phasor Components (HT_PHASOR)".
- Updated the SSF-Based Detrended Synthetic Price to "Ehlers SSF Detrended Synthetic Price (SSFDSP)".
- Renamed the Ultimate Channel to "Ehlers Ultimate Channel (UCHANNEL)".
- Added new indicators: Moving Average Variable Period (MAVP), Ehlers Predictive Moving Average (PMA), Ehlers Reverse EMA (REVERSEEMA), and Ehlers Trendflex Indicator (TRENDFLEX).
- Updated various SVG badges to reflect changes in classes, comments, source files, lines of code, methods, and public types.
2026-02-18 19:08:15 -08:00
Miha Kralj 24e86d762a Add documentation links for various volatility indicators and channels
- Updated BBWN, BBWP, CCV, CV, CVI, EWMA, GKV, HLV, HV, Jvolty, JVOLTYN, MASSI, NATR, RSV, RV, RVI, TR, UI, VOV, VR, YZV indicators with documentation links.
- Added documentation links for Aberration, Acceleration Bands, Andrews' Pitchfork, Adaptive Price Zone, ATR Bands, Bollinger Bands, Center of Gravity, Donchian Channels, Decay Min-Max Channel, Detrended Synthetic Price, EACP, EBSW, HOMOD, Jurik Volatility Bands, Keltner Channel, MA Envelope, Min-Max Channel, Price Channel, Regression Channels, Standard Deviation Channel, Stoller Average Range Channel, Super Trend Bands, Ultimate Bands, Ultimate Channel, VWAP Bands, and VWAP with Standard Deviation Bands.
2026-02-18 11:55:48 -08:00
Miha Kralj fa56e2b76d Refactor exact-zero guards and update mathematical notations across multiple classes to enhance clarity and prevent division by zero errors. 2026-02-16 22:30:30 -08:00
Miha Kralj b63b9730e1 Add exact-zero guards in various classes to prevent division by zero errors 2026-02-16 21:57:11 -08:00
Miha Kralj 63ae2c9ab2 Add TTM Scalper indicator implementation in C# and Pine Script; update Blma class for average calculation; remove missing indicators report and oscillator docs rewrite plans. 2026-02-16 21:26:44 -08:00
Miha Kralj b3a64f18fa Implement ZTEST: One-Sample t-Test Statistic with validation tests
- Added Ztest class to compute the one-sample t-statistic using sample standard deviation with Bessel correction.
- Implemented validation tests for Ztest to ensure accuracy against manual calculations and PineScript.
- Updated documentation for Ztest, detailing its mathematical foundation, performance profile, and common pitfalls.
- Adjusted NDepend badges to reflect changes in code metrics after implementation.
- Updated missing indicators report to reflect the completion of statistical indicators, including ZTEST.
2026-02-16 16:54:36 -08:00
Miha Kralj 09ffd31a40 Update SVG badges and missing indicators report
- Updated class count in classes.svg from 938 to 1078.
- Adjusted comments percentage in comments.svg from 33.06 to 33.02.
- Revised average cyclomatic complexity in complexity.svg from 2.19 to 2.12.
- Increased source files count in files.svg from 1099 to 1275.
- Updated lines of code in loc.svg from 114549 to 129859.
- Increased methods count in methods.svg from 12035 to 14066.
- Updated public types count in public-api.svg from 1086 to 1225.
- Revised missing indicators report with updated counts and categories, reflecting recent implementations and planned additions.
2026-02-15 21:59:03 -08:00
Miha Kralj dfeb23bf3d Add Savitzky-Golay Moving Average (SGMA) Indicator Implementation
- Implemented SgmaIndicator class in C# with properties for Period, Degree, and Source.
- Added unit tests for SgmaIndicator covering constructor defaults, initialization, and various update scenarios.
- Created a new Quantower adapter for the SGMA indicator, including input parameters and line series setup.
- Removed legacy SGMA implementation and tests to streamline the codebase.
- Updated project files to include new indicator and tests in the build process.
- Generated a missing indicators report and outlined a plan for oscillator documentation rewrite.
2026-02-13 21:44:45 -08:00
Miha Kralj 951842acca Add validation tests for various volume and momentum indicators
- Introduced Massi validation tests to ensure mathematical properties hold for the Mass Index indicator.
- Added Va validation tests for Volume Accumulation, checking for finite outputs and correct accumulation behavior.
- Implemented Vf validation tests for Volume Force, verifying outputs for rising and falling prices, and ensuring batch and streaming results match.
- Created Vo validation tests for Volume Oscillator, confirming behavior with constant, increasing, and decreasing volumes.
- Developed Vroc validation tests for Volume Rate of Change, validating outputs for constant volume and changes in volume.
- Updated project file to include new momentum indicators (MACD and RSI) in the compilation.
2026-02-12 19:43:09 -08:00
Miha Kralj 92709ef2ed Add Stochastic Oscillator implementation and validation tests
- Implemented Stochastic Oscillator (%K and %D) in Stoch.cs with streaming and batch processing capabilities.
- Added validation tests for the Stochastic Oscillator in Stoch.Validation.Tests.cs, ensuring consistency with Skender.Stock.Indicators.
- Created documentation for the Stochastic Oscillator in Stoch.md, detailing its mathematical formula, architecture, parameters, and common pitfalls.
- Updated project file to include necessary numeric libraries for highest and lowest calculations.
2026-02-12 14:29:54 -08:00
Miha Kralj 653aafacd8 feat: Add Prime method to various indicators for initializing state with historical data
- Implemented Prime method in Vel, Ao, Apo, Frama, Adl, Adosc, Aobv, Cmf, Efi, Eom, Iii, Kvo, Mfi, Nvi, Obv, Pvd, Pvi, Pvo, Pvr, Pvt, Tvi, Twap, Va, Vf, Vo, Vroc, Vwad, Vwap, and Vwma classes.
- The Prime method resets the indicator state and processes the provided historical bar data to initialize the indicator.
- Added warmup period property to Adl and Wad classes to define the minimum number of data points required for validity.
- Updated benchmark tests to use Batch methods for performance evaluation.
2026-02-11 20:38:38 -08:00
Miha Kralj 75c6a9f135 Enhance validation tests for various indicators with external library comparisons
- Added detailed comments explaining the validation limitations for MMA and ZLEMA due to differences in algorithm implementations.
- Implemented validation tests for True Range against TALib and Tulip, ensuring directional agreement.
- Updated Ulcer Index validation to clarify differences in algorithmic approaches between QuanTAlib and Skender.
- Enhanced Ease of Movement tests to verify directional agreement with Tulip's EMV, noting differences in volume scaling.
- Expanded Klinger Volume Oscillator tests to validate against Skender and Tulip, focusing on directional agreement across multiple period configurations.
- Improved Negative Volume Index tests to compare percentage changes with Tulip, addressing differences in starting values.
- Updated Positive Volume Index tests to validate against Tulip, emphasizing percentage change comparisons.
- Enhanced Williams Accumulation/Distribution tests to verify directional agreement with Tulip, highlighting formula differences.
2026-02-11 14:46:56 -08:00