normalization of methods

This commit is contained in:
Miha Kralj
2026-02-10 21:33:16 -08:00
parent 915d7a007b
commit 6d6259a47d
527 changed files with 10525 additions and 2123 deletions
+1 -1
View File
@@ -320,7 +320,7 @@ public class EbswTests
tSeries.Add(new TValue(bar.Time, bar.Close));
}
var batch = Ebsw.Calculate(tSeries, hpLength, ssfLength);
var batch = Ebsw.Batch(tSeries, hpLength, ssfLength);
// Compare last values
Assert.Equal(batch[^1].Value, streaming.Last.Value, Tolerance);
+2 -2
View File
@@ -296,7 +296,7 @@ public class EbswValidationTests
tSeries.Add(new TValue(bar.Time, bar.Close));
}
var batch = Ebsw.Calculate(tSeries, hpLength, ssfLength);
var batch = Ebsw.Batch(tSeries, hpLength, ssfLength);
// Compare last values
Assert.Equal(batch[^1].Value, streaming.Last.Value, Tolerance);
@@ -319,7 +319,7 @@ public class EbswValidationTests
tSeries.Add(new TValue(bar.Time, bar.Close));
}
var tSeriesResult = Ebsw.Calculate(tSeries, hpLength, ssfLength);
var tSeriesResult = Ebsw.Batch(tSeries, hpLength, ssfLength);
// Span approach
double[] source = new double[dataLen];
+8 -1
View File
@@ -246,7 +246,7 @@ public sealed class Ebsw : AbstractBase
/// <summary>
/// Calculates EBSW for a time series.
/// </summary>
public static TSeries Calculate(TSeries source, int hpLength = 40, int ssfLength = 10)
public static TSeries Batch(TSeries source, int hpLength = 40, int ssfLength = 10)
{
var ebsw = new Ebsw(hpLength, ssfLength);
return ebsw.Update(source);
@@ -337,4 +337,11 @@ public sealed class Ebsw : AbstractBase
filt1 = filt0;
}
}
public static (TSeries Results, Ebsw Indicator) Calculate(TSeries source, int hpLength = 40, int ssfLength = 10)
{
var indicator = new Ebsw(hpLength, ssfLength);
TSeries results = indicator.Update(source);
return (results, indicator);
}
}