fix: Update ADL calculation to handle empty source and improve versioning in Publish.yml

This commit is contained in:
Miha Kralj
2025-12-18 22:00:11 -08:00
parent b5358091ae
commit a37d5818be
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -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)]