chore: Update various indicators to improve null handling and code readability

This commit is contained in:
Miha Kralj
2025-12-08 18:02:36 -05:00
parent c2b33a8320
commit 53a2dd2c05
7 changed files with 15 additions and 11 deletions
+4 -4
View File
@@ -119,8 +119,8 @@ public static class IndicatorExtensions
public static List<Point> GetSmoothCurvePoints(Indicator indicator, IChartWindowCoordinatesConverter converter, Rectangle clientRect, LineSeries series)
{
if (indicator == null) throw new ArgumentNullException(nameof(indicator));
if (converter == null) throw new ArgumentNullException(nameof(converter));
ArgumentNullException.ThrowIfNull(indicator);
ArgumentNullException.ThrowIfNull(converter);
var data = indicator.HistoricalData;
if (data == null) return new List<Point>();
@@ -193,8 +193,8 @@ public static class IndicatorExtensions
public static List<(Rectangle Rect, Color Color)> GetHistogramRectangles(Indicator indicator, IChartWindowCoordinatesConverter converter, Rectangle clientRect, LineSeries series)
{
if (indicator == null) throw new ArgumentNullException(nameof(indicator));
if (converter == null) throw new ArgumentNullException(nameof(converter));
ArgumentNullException.ThrowIfNull(indicator);
ArgumentNullException.ThrowIfNull(converter);
var data = indicator.HistoricalData;
if (data == null) return new List<(Rectangle, Color)>();