mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-15 00:58:04 +00:00
fix: Update ADL calculation to handle empty source and improve versioning in Publish.yml
This commit is contained in:
@@ -129,14 +129,14 @@ public sealed class Adl : ITValuePublisher
|
||||
|
||||
public static TSeries Calculate(TBarSeries source)
|
||||
{
|
||||
if (source.Count == 0) return new TSeries(0);
|
||||
if (source.Count == 0) return [];
|
||||
|
||||
var t = source.Open.Times; // Times are same for all series
|
||||
var v = new double[source.Count];
|
||||
|
||||
Calculate(source.High.Values, source.Low.Values, source.Close.Values, source.Volume.Values, v);
|
||||
|
||||
return new TSeries(new List<long>(t.ToArray()), new List<double>(v));
|
||||
return new TSeries([.. t], [.. v]);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
||||
Reference in New Issue
Block a user