mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 21:48:03 +00:00
style patterns
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user