style patterns

This commit is contained in:
Miha Kralj
2026-01-25 16:01:45 -08:00
parent 2836f253c4
commit e59665c8f0
399 changed files with 6892 additions and 1323 deletions
+1 -1
View File
@@ -206,4 +206,4 @@ public class AdlTests
Assert.Equal((i + 1) * 10, output[i]);
}
}
}
}
+7 -2
View File
@@ -129,7 +129,10 @@ public sealed class Adl : ITValuePublisher
public static TSeries Calculate(TBarSeries source)
{
if (source.Count == 0) return [];
if (source.Count == 0)
{
return [];
}
var t = source.Open.Times.ToArray(); // Times are same for all series
var v = new double[source.Count];
@@ -143,7 +146,9 @@ public sealed class Adl : ITValuePublisher
public static void Calculate(ReadOnlySpan<double> high, ReadOnlySpan<double> low, ReadOnlySpan<double> close, ReadOnlySpan<double> volume, Span<double> output)
{
if (high.Length != low.Length || high.Length != close.Length || high.Length != volume.Length || high.Length != output.Length)
{
throw new ArgumentException("All spans must be of the same length", nameof(output));
}
int len = high.Length;
int i = 0;
@@ -196,4 +201,4 @@ public sealed class Adl : ITValuePublisher
output[i] = sum;
}
}
}
}