mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-25 13:58:04 +00:00
normalization of methods
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user