mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-23 13:08:04 +00:00
style patterns
This commit is contained in:
@@ -203,4 +203,4 @@ public class StbandsIndicatorTests
|
||||
Assert.True(trend == 1 || trend == -1, $"Trend should be +1 or -1, got {trend}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,4 +70,4 @@ public class StbandsIndicator : Indicator, IWatchlistIndicator
|
||||
TrendSeries!.SetValue(stbands.Trend.Value, stbands.IsHot, ShowColdValues);
|
||||
WidthSeries!.SetValue(stbands.Width.Value, stbands.IsHot, ShowColdValues);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,4 +420,4 @@ public class StbandsTests
|
||||
// Assert
|
||||
Assert.Equal(stbands.Upper.Value - stbands.Lower.Value, stbands.Width.Value, precision: 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,4 +376,4 @@ public sealed class StbandsValidationTests : IDisposable
|
||||
$"Higher multiplier should produce wider bands (mult={multipliers[i]})");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,11 +175,17 @@ public sealed class Stbands : AbstractBase
|
||||
|
||||
// Determine trend
|
||||
if (close <= finalLower)
|
||||
{
|
||||
trend = 1; // Bullish
|
||||
}
|
||||
else if (close >= finalUpper)
|
||||
{
|
||||
trend = -1; // Bearish
|
||||
}
|
||||
else
|
||||
{
|
||||
trend = prevTrend;
|
||||
}
|
||||
}
|
||||
|
||||
// Update state
|
||||
@@ -374,9 +380,13 @@ public sealed class Stbands : AbstractBase
|
||||
|
||||
// Determine trend
|
||||
if (c <= finalLower)
|
||||
{
|
||||
currentTrend = 1;
|
||||
}
|
||||
else if (c >= finalUpper)
|
||||
{
|
||||
currentTrend = -1;
|
||||
}
|
||||
}
|
||||
|
||||
upper[i] = finalUpper;
|
||||
@@ -385,4 +395,4 @@ public sealed class Stbands : AbstractBase
|
||||
prevClose = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user