Commit Graph

70 Commits

Author SHA1 Message Date
Miha Kralj 2a554963d8 feat: Implement IEquatable for state structures in Dema, Ema, T3, Tema, and Hma classes; update IsHot logic in Hma 2025-12-07 18:12:24 -08:00
Miha Kralj 3975ff2d7f Refactor T3 Moving Average Implementation and Remove Unused Tests
- Deleted DebugTulip.Tests.cs as it was no longer needed.
- Refactored T3.cs to encapsulate parameters in a struct for better organization and readability.
- Updated methods in T3.cs to use the new Parameters struct, improving clarity and reducing redundancy.
- Enhanced T3.md documentation to provide clearer explanations of the T3 moving average and its parameters.
- Removed Wma.Coverage.Tests.cs as it was obsolete.
- Added new tests in IndicatorExtensions.Tests.cs to validate logic methods and ensure correct calculations.
- Updated IndicatorExtensions.cs to improve method organization and add new functionality for handling chart coordinates.
- Refactored mocks in TradingPlatformMocks.cs to align with new chart interface definitions.
2025-12-07 17:32:01 -08:00
Miha Kralj 94d06b0749 T3 Moving Average and associated tests 2025-12-07 17:10:41 -08:00
Miha Kralj 875998b288 Add eventing support to WMA indicator and implement unit tests for various indicators
- Enhanced WMA indicator with event-driven capabilities using ITValuePublisher interface.
- Created a new TODO file listing various indicators and their corresponding libraries.
- Added unit tests for DEMA, HMA, TEMA, and WMA indicators to ensure proper functionality.
- Implemented tests for handling new bars, ticks, and historical data updates across indicators.
- Verified that indicators correctly compute values and handle different source types.
2025-12-07 16:46:38 -08:00
Miha Kralj 3734a1c5f6 feat: Introduce ITValuePublisher interface and refactor indicators for event-driven value updates. 2025-12-07 14:36:22 -08:00
Miha Kralj 3b146b68bd Refactor tests and improve random number generation handling; update Dema, Ema, Sma, Tema, Wma, and GBM classes for consistency and clarity 2025-12-05 10:33:27 -08:00
Miha Kralj 9e152b9027 Add TEMA (Triple Exponential Moving Average) implementation and validation tests
- Implemented TEMA calculation in QuanTAlib with O(1) update complexity.
- Added validation tests for TEMA against Skender, TA-Lib, and Tulip indicators.
- Updated documentation for TEMA, including its mathematical foundation and usage examples.
- Enhanced existing tests for other indicators (TRIMA, WMA) to generate more records.
- Adjusted benchmark tests to include DEMA and TEMA comparisons.
- Refactored code for better readability and performance, including zero-allocation Span API.
2025-12-04 19:57:46 -08:00
Miha Kralj ee358bfdd9 Enhance coding conventions and static analysis setup; update .editorconfig, scanner.sh, and various C# files for improved readability and performance 2025-12-04 14:36:00 -08:00
Miha Kralj 967096d4f5 Refactor and optimize various components of QuanTAlib
- Removed WmaVector class to streamline weighted moving average calculations.
- Simplified RingBuffer implementation by removing unnecessary comments and improving clarity.
- Enhanced SIMD extensions for better performance and readability.
- Updated TBar and TBarSeries classes to improve property calculations and reduce overhead.
- Cleaned up TValue struct by removing redundant comments.
- Added comprehensive unit tests for IndicatorExtensions and TrimaIndicator to ensure functionality and correctness.
2025-12-04 13:49:05 -08:00
Miha Kralj 3ed35322a5 Add TRIMA implementation and benchmarks; optimize WMA with SIMD
- Introduced `TrimaVector` class for multi-period Triangular Moving Average (TRIMA) calculations, optimized for SIMD.
- Implemented last-value substitution for invalid inputs in TRIMA.
- Added methods for calculating TRIMA for entire series and individual updates.
- Enhanced `Wma` class with periodic resync to prevent floating-point drift and introduced SIMD optimizations for performance.
- Updated benchmark suite to include TRIMA calculations alongside existing SMA, EMA, and WMA benchmarks.
2025-12-04 13:05:56 -08:00
Miha Kralj 4a0435c217 Refactor EMA, SMA, and WMA indicators to improve warmup tracking and coverage calculations; enhance tests for IsHot behavior and period dependency; update project files for better structure and maintainability. 2025-12-03 13:49:45 -08:00
Miha Kralj 4a0a8d6da2 chore: Update project files and configurations; enhance .gitignore, add Qodana and SonarScanner scripts, and improve test project references 2025-12-03 09:27:29 -08:00
Miha Kralj 626a2afa9b chore: Update .gitignore to exclude SonarQube files and add Codacy and SonarScanner scripts
refactor: Remove WarmupPeriod logging from SMA and WMA examples
2025-11-30 17:17:55 -08:00
Miha Kralj a1de42ec80 Refactor SMA and WMA validation tests to include batch, streaming, and span methods
- Updated SMA validation tests to include separate methods for Skender and TA-Lib with batch, streaming, and span calculations.
- Enhanced WMA validation tests similarly, ensuring comprehensive coverage for Skender and TA-Lib.
- Improved verification helper methods for better clarity and maintainability.
2025-11-29 21:42:21 -08:00
Miha Kralj e89af1d357 feat: Add Name property to EMA, SMA, and WMA classes for better identification 2025-11-29 21:25:55 -08:00
Miha Kralj 2d28b8f62a Add Span API for SMA, EMA, and WMA with zero-allocation performance improvements
- Implemented zero-allocation methods for SMA, EMA, and WMA calculations using ReadOnlySpan and Span.
- Added unit tests for Span API to validate input, match TSeries calculations, handle NaN values, and ensure zero allocation.
- Enhanced documentation to include usage examples for the new Span API.
- Introduced performance benchmarks comparing the new Span API against existing TSeries implementations and other libraries.
2025-11-29 20:48:01 -08:00
Miha Kralj 5c1fb18520 Implement Weighted Moving Average (WMA) and Multi-Period WMA (WmaVector) classes with O(1) update complexity
- Added Wma class for calculating the Weighted Moving Average with detailed documentation and optimized performance using dual running sums.
- Introduced WmaVector class to handle multiple WMAs simultaneously, supporting batch calculations and real-time updates.
- Implemented last-value substitution for handling invalid inputs (NaN/Infinity) in both classes.
- Created comprehensive unit tests for Wma and WmaVector to ensure accuracy and reliability of calculations.
- Updated documentation to include usage examples, mathematical foundations, and performance characteristics.
2025-11-29 19:31:50 -08:00
Miha Kralj 1f80cfda74 feat: Implement SIMD-optimized Multi-Period Simple Moving Average (SMA) with RingBuffer
- Added SmaVector class for calculating multiple SMAs in parallel using SIMD.
- Introduced RingBuffer class for efficient circular buffer management with running sum.
- Implemented unit tests for RingBuffer to ensure correctness and performance.
- Enhanced Add method in RingBuffer to support bar correction semantics.
- Added methods for calculating Min and Max using SIMD acceleration.
- Improved performance with pinned memory and direct span access for SIMD compatibility.
2025-11-29 18:28:42 -08:00
Miha Kralj 8f6142cfc0 refactor: clean up Ema and EmaVector tests for consistency, update TValue equality check 2025-11-29 17:30:20 -08:00
Miha Kralj ce77bc9c85 refactor: update NoWarn codes and clean up EmaValidationTests and EmaVectorTests 2025-11-29 17:04:56 -08:00
Miha Kralj 622e4c8ae6 refactor: update Ema and EmaVector tests to use DateTime.UtcNow for consistency 2025-11-29 16:54:15 -08:00
Miha Kralj 2b4e8e3fc3 Add UCFG2 type definitions and lock file for QuanTAlib
- Introduced type definitions for various classes in the QuanTAlib library, including Ema, EmaVector, EmaState, TSeries, CsvFeed, GBM, TBarSeries, TBar, and TValue.
- Added methods and properties for each class to enhance functionality and maintainability.
- Created a lock file to manage dependencies and ensure consistent builds.
2025-11-29 16:43:52 -08:00
Miha Kralj 8d8e60098e Refactor and expand unit tests for TBarSeries, TSeries, and TValue classes
- Enhanced TBarSeriesTests with additional constructors, methods, and assertions for better coverage.
- Improved TSeriesTests to include new constructors, methods, and edge cases.
- Expanded TValueTests to cover constructors, implicit conversions, equality checks, and hash codes.
- Updated project file to target .NET 10.0 and include internal visibility for tests.
- Added Codacy configuration for code quality checks.
2025-11-29 16:08:45 -08:00
Miha Kralj 6cdebb984d feat: implement last-value substitution for NaN/Infinity in Ema and EmaVector, enhance documentation and tests 2025-11-29 13:19:04 -08:00
Miha Kralj acac3e610c updates from mac 2025-11-28 13:35:16 -08:00
Miha Kralj 74b49d2bb4 Add TBar, TBarSeries, TSeries, TValue, and IFeed implementations with comprehensive documentation and examples
- Introduced TBar struct for efficient OHLCV data representation.
- Implemented TBarSeries class for high-performance collection of TBar instances using Structure of Arrays (SoA) layout.
- Added TSeries class for time-series data management with zero-copy access.
- Created TValue struct for time-value pairs with implicit conversions.
- Defined IFeed interface for consistent data feed implementations.
- Developed CsvFeed class for loading historical OHLCV data from CSV files.
- Implemented GBM class for generating synthetic financial data using Geometric Brownian Motion.
- Added Quantower project files for Averages indicator with necessary dependencies and configurations.
- Included extensive usage examples and notebooks for TBar, TBarSeries, TSeries, TValue, and feed implementations.
2025-11-27 19:51:43 -08:00
Miha Kralj 33ffd3a37a first iteration 2025-11-25 20:40:46 -08:00
miha 0f7cfb4b50 Optimize SMA to O(1) using running sum algorithm
- Changed from O(n) CircularBuffer.Average() to O(1) running sum
- Maintains _sum and _p_sum for state management
- Tracks _lastValue and _p_lastValue for isNew=false updates
- Provides ~15-20x speedup for large periods
- Pattern verified against Pine Script reference implementation
- All tests pass including update test for isNew handling

Also added .github/copilot-instructions.md with comprehensive
AI agent guidance for QuanTAlib development patterns
2025-10-21 18:47:10 -07:00
Miha Kralj 351214ed31 moar Chart indicators 2024-11-07 21:40:02 -08:00
Miha Kralj f582db2c4c fixes 2024-11-05 05:52:54 -08:00
Miha Kralj 7f6c29151c Fixes 2024-11-03 15:52:25 -08:00
Miha Kralj 94928714bf sonar fixes 2024-11-03 15:52:25 -08:00
codefactor-io a0c99ef326 [CodeFactor] Apply fixes 2024-11-03 23:47:53 +00:00
codefactor-io e60cf47d3a [CodeFactor] Apply fixes 2024-11-03 23:03:24 +00:00
Miha 6231bab9e5 feat: Dpo, Tsi, Vortex, Bpp, Cci, Cfo, Tr, Ui, Vc, Vov, Vr, Vs, Mfi, Nvi, Obv, Pvi, Pvo, Pvol, Pvr, Pvt, Tvi 2024-10-30 13:45:36 -07:00
Miha 6c67a0cf31 Class optimization 2024-10-27 16:11:08 -07:00
Miha b2fcdda785 xml doc rewrite 2024-10-27 09:38:53 -07:00
Miha c21b96152c macos dev update 2024-10-26 23:54:55 -07:00
Miha Kralj efc8e553db Rsi and Rsx 2024-10-24 18:30:59 -07:00
Miha Kralj e3d7cd9896 Atr, FlowIndicator and fixes 2024-10-21 16:06:47 -07:00
Miha Kralj fbe4046b5d Documentation 2024-10-16 18:28:06 -07:00
Miha Kralj ffed6491d4 corrections 2024-10-13 17:31:35 -07:00
Miha Kralj cc45cebeb4 tests and cleanup 2024-10-11 18:02:09 -07:00
Miha Kralj 839313c9f2 Pwma 2024-10-10 16:23:23 -07:00
Miha Kralj 5974f54953 removed Archive 2024-10-09 14:38:51 -07:00
deepsource-autofix[bot] 47862d8682 style: format code with dotnet-format
This commit fixes the style issues introduced in 0bc4185 according to the output
from dotnet-format.

Details: https://github.com/mihakralj/QuanTAlib/pull/32
2024-10-08 21:00:48 +00:00
Miha Kralj 0bc41854aa cleanup 2024-10-08 13:59:33 -07:00
deepsource-autofix[bot] 838f664862 style: format code with dotnet-format
This commit fixes the style issues introduced in a7eeacf according to the output
from dotnet-format.

Details: None
2024-10-08 17:47:49 +00:00
Miha Kralj a7eeacf8cb Merge branch 'dev' 2024-10-08 10:47:21 -07:00
deepsource-autofix[bot] 85b9d9217a style: format code with dotnet-format
This commit fixes the style issues introduced in 931bbdb according to the output
from dotnet-format.

Details: https://github.com/mihakralj/QuanTAlib/pull/30
2024-10-08 17:31:29 +00:00