Commit Graph

548 Commits

Author SHA1 Message Date
Miha Kralj 5f57cbbe74 refactor: Simplify TSeries and Dema constructors, and streamline benchmark methods for improved readability 2025-12-08 18:43:23 -05:00
Miha Kralj 53a2dd2c05 chore: Update various indicators to improve null handling and code readability 2025-12-08 18:02:36 -05:00
Miha Kralj c2b33a8320 Add unit tests for various indicators and update project file
- Implemented unit tests for the following indicators:
  - KAMA (Kaufman Adaptive Moving Average)
  - SMA (Simple Moving Average)
  - T3 (Tillson T3 Moving Average)
  - TEMA (Triple Exponential Moving Average)
  - TRIMA (Triangular Moving Average)
  - WMA (Weighted Moving Average)

- Each test class includes tests for constructor defaults, history depth, short name, initialization, processing updates, and source type handling.

- Updated the Quantower.Tests.csproj to include all new test files in the lib directory.
2025-12-08 11:40:21 -08:00
Miha Kralj ed5e5c8209 Add unit tests for various moving average indicators
- Implement tests for HMA (Hull Moving Average) indicator to verify default settings, history depth calculations, and value computations during updates.
- Create tests for KAMA (Kaufman Adaptive Moving Average) indicator, ensuring correct defaults, history depth, and value calculations.
- Add tests for SMA (Simple Moving Average) indicator, checking default values, history depth, and value computations.
- Develop tests for T3 (Tillson T3 Moving Average) indicator, validating defaults, history depth, and value calculations.
- Implement tests for TEMA (Triple Exponential Moving Average) indicator, ensuring correct defaults and value computations.
- Create tests for TRIMA (Triangular Moving Average) indicator, verifying defaults, history depth, and value calculations.
- Add tests for WMA (Weighted Moving Average) indicator, checking default values, history depth, and value computations.
2025-12-08 11:00:58 -08:00
Miha Kralj 488de7ea1e chore: Update documentation links and improve code readability in averages and tests 2025-12-07 20:44:24 -08:00
Miha Kralj 03df45003e chore: Enhance Snyk scan and GitVersion regex for improved branch handling 2025-12-07 20:26:19 -08:00
Miha Kralj 944c215327 chore: Simplify Snyk test command by removing unnecessary options 2025-12-07 20:10:27 -08:00
Miha Kralj 8277ed9ccf chore: Add Snyk CLI installation and update CodeQL action versions; add assertion for SonarCloud compliance 2025-12-07 20:05:09 -08:00
Miha Kralj 28f7e981c0 chore: Add check for CODACY_PROJECT_TOKEN before upload to Codacy 2025-12-07 19:59:22 -08:00
Miha Kralj e951f0a602 chore: Update Publish.yml for SonarCloud token handling and improve logging configuration 2025-12-07 19:54:05 -08:00
Miha Kralj 36526e1d43 chore: Update Publish.yml to switch shell to bash, add SONAR_TOKEN validation, and enable verbose logging for SonarCloud analysis 2025-12-07 19:44:26 -08:00
Miha Kralj 910f2751f0 chore: Update Publish.yml to improve SonarCloud scanner commands and enhance checkout steps with fetch-depth 2025-12-07 19:36:27 -08:00
Miha Kralj 966dc83131 chore: Update Publish.yml to enhance CI workflow with improved coverage reporting and additional job steps 2025-12-07 19:28:09 -08:00
Miha Kralj 3f7ca390bf chore: Update Publish.yml to run on ubuntu-latest; specify SonarScanner version and improve coverage report paths 2025-12-07 18:53:40 -08:00
Miha Kralj 5f8fef513b chore: Remove SonarCloud scanner caching from Publish.yml; update Qodana linter version in qodana.yaml 2025-12-07 18:45:45 -08:00
Miha Kralj 00643e74c2 chore: Update shell from powershell to pwsh in Publish.yml; specify Qodana linter version in qodana.yaml 2025-12-07 18:37:14 -08:00
Miha Kralj 6323f43db4 chore: Update .github workflows for .NET version and action dependencies; add Qodana scan job 2025-12-07 18:34:06 -08:00
Miha Kralj 39feabcdf7 refactor: Remove pragma warning for floating point equality in TBar struct; update .editorconfig to suppress SonarQube S1244 2025-12-07 18:20:55 -08:00
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 5cc27c97de Trima added; ema, sma, wma optimized. 2025-12-04 13:05:40 -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 1d145d0622 Refactor TBar struct for improved equality comparison and string representation; update Benchmark program structure for better organization; modify Averages project file to include specific source files; add Directory.Build.props for common project settings; implement comprehensive tests for Ema, Sma, and Wma indicators; create mock classes for TradingPlatform.BusinessLayer to facilitate testing; enhance Quantower test project configuration for better test management. 2025-12-01 18:40:23 -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 4dd753f7c0 Remove obsolete SonarQube configuration files and related typedefs from the project, including multiple .ucfgs and .typedefs files, to clean up the repository and improve maintainability. 2025-11-30 17:17:35 -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 1401f1792e refactor: Remove unused Program.cs file and clean up Benchmark.cs 2025-11-29 21:08:29 -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 1c8f514756 next iteration 2025-11-26 20:17:01 -08:00
Miha Kralj 33ffd3a37a first iteration 2025-11-25 20:40:46 -08:00