Commit Graph

531 Commits

Author SHA1 Message Date
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
Miha Kralj b5881b9bb4 feat: add CSV feed and GBM examples
- Add CsvFeedExample console app demonstrating CSV data loading and streaming
- Add GbmExample console app for geometric Brownian motion feed
- Add CoreTypes example project
- Include daily_IBM.csv test data file
- Configure project files for .NET 10.0 with quantalib dependency
2025-11-25 20:40:18 -08:00
Miha Kralj 11ff82c7ac Add chatmodes and update test files 2025-10-21 18:50:23 -07: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 530dfe0aa2 chore: snapshot current state 2025-09-23 22:01:11 -07:00
Miha 140eb59722 .NET 9 update 2024-11-13 21:29:43 -05:00
Miha e3d6bbc54a .NET 9 update 2024-11-13 21:28:41 -05:00
codefactor-io 697f15cc0c [CodeFactor] Apply fixes to commit 4286113 2024-11-11 00:56:50 +00:00
Miha 428611315e prep 2024-11-10 11:11:38 -08:00
Miha Kralj 770b1e0d27 Merge remote-tracking branch 'origin/dev' into dev 2024-11-10 11:09:25 -08:00
Miha Kralj df74feaba1 prep 2024-11-10 11:09:18 -08:00
codefactor-io 7ee4bd4ca9 [CodeFactor] Apply fixes to commit f46a533 2024-11-09 05:20:15 +00:00
Miha f46a5330bf Covar, Kendall, Spearman 2024-11-08 21:20:06 -08:00
codefactor-io fce3a783eb [CodeFactor] Apply fixes to commit 02c9271 2024-11-08 10:27:39 -08:00
Miha Kralj 4f738e6476 Merge remote-tracking branch 'origin/dev' into dev 2024-11-08 10:07:47 -08:00
Miha Kralj 02c92712a0 CTI 2024-11-08 10:07:11 -08:00
codefactor-io 06782a5a4d [CodeFactor] Apply fixes to commit 11fc798 2024-11-08 16:25:08 +00:00
Miha Kralj 11fc798517 CTI - Ehler's Correlation Trend - calc and chart 2024-11-08 08:24:51 -08:00