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
@@ -74,4 +74,4 @@ public class UchannelIndicator : Indicator, IWatchlistIndicator
StrSeries!.SetValue(uchannel.STR.Value, uchannel.IsHot, ShowColdValues);
WidthSeries!.SetValue(uchannel.Width.Value, uchannel.IsHot, ShowColdValues);
}
}
}
+1 -1
View File
@@ -497,4 +497,4 @@ public class UchannelTests
Assert.Equal(uchannel1.Upper.Value, uchannel2.Upper.Value, precision: 10);
Assert.Equal(uchannel1.Lower.Value, uchannel2.Lower.Value, precision: 10);
}
}
}
@@ -436,4 +436,4 @@ public class UchannelValidationTests
// Should produce same results
Assert.Equal(valueBefore, valueAfter, precision: 10);
}
}
}
+15 -4
View File
@@ -87,6 +87,9 @@ public sealed class Uchannel : AbstractBase
/// <summary>Gets the channel width (Upper - Lower).</summary>
public TValue Width => new(Upper.Time, Upper.Value - Lower.Value);
/// <summary>
///
/// </summary>
/// <param name="strPeriod">Period for smoothing True Range. Must be >= 1.</param>
/// <param name="centerPeriod">Period for smoothing centerline. Must be >= 1.</param>
/// <param name="multiplier">Band multiplier for STR. Must be > 0.</param>
@@ -403,11 +406,19 @@ public sealed class Uchannel : AbstractBase
int length = close.Length;
if (high.Length != length || low.Length != length)
{
throw new ArgumentException("All input arrays must have the same length", nameof(high));
if (upper.Length != length || middle.Length != length || lower.Length != length)
throw new ArgumentException("Output arrays must match input length", nameof(upper));
}
if (length == 0) return;
if (upper.Length != length || middle.Length != length || lower.Length != length)
{
throw new ArgumentException("Output arrays must match input length", nameof(upper));
}
if (length == 0)
{
return;
}
// Compute USF coefficients
double arg_str = Math.Sqrt(2) * Math.PI / strPeriod;
@@ -503,4 +514,4 @@ public sealed class Uchannel : AbstractBase
prevClose = c;
}
}
}
}