mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 02:58:05 +00:00
Add Ehlers Hilbert Transform Instantaneous Trend (HTIT) implementation and tests
- Implemented the HTIT indicator in Htit.cs, utilizing the Hilbert Transform for trend analysis. - Added unit tests for HTIT validation against TA-Lib, Skender, and Ooples implementations in Htit.Validation.Tests.cs. - Created documentation for HTIT in Htit.md, detailing its core concepts, formula, parameters, usage, and interpretation.
This commit is contained in:
@@ -110,13 +110,14 @@ public sealed class RingBuffer : IEnumerable<double>
|
||||
|
||||
/// <summary>
|
||||
/// Gets the newest (most recently added) value.
|
||||
/// Returns double.NaN if buffer is empty.
|
||||
/// </summary>
|
||||
public double Newest
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
if (_count == 0) return 0;
|
||||
if (_count == 0) return double.NaN;
|
||||
int idx = (_head - 1 + _capacity) % _capacity;
|
||||
return _buffer[idx];
|
||||
}
|
||||
@@ -124,13 +125,14 @@ public sealed class RingBuffer : IEnumerable<double>
|
||||
|
||||
/// <summary>
|
||||
/// Gets the oldest value in the buffer.
|
||||
/// Returns double.NaN if buffer is empty.
|
||||
/// </summary>
|
||||
public double Oldest
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
if (_count == 0) return 0;
|
||||
if (_count == 0) return double.NaN;
|
||||
int start = _count == _capacity ? _head : 0;
|
||||
return _buffer[start];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user