From 1bec3c5011ed7369492f91a90506a4f988444e6a Mon Sep 17 00:00:00 2001 From: moshferatu Date: Fri, 26 Apr 2024 08:09:51 -0700 Subject: [PATCH] Remove unused imports and use Input rather than Close in order to support smoothing other indicator values --- indicators/SuperSmoother.cs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/indicators/SuperSmoother.cs b/indicators/SuperSmoother.cs index f3c7c2d..dad8f24 100644 --- a/indicators/SuperSmoother.cs +++ b/indicators/SuperSmoother.cs @@ -1,24 +1,9 @@ #region Using declarations using System; -using System.Collections.Generic; -using System.ComponentModel; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Input; using System.Windows.Media; -using System.Xml.Serialization; -using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; -using NinjaTrader.Gui.SuperDom; -using NinjaTrader.Gui.Tools; -using NinjaTrader.Data; -using NinjaTrader.NinjaScript; -using NinjaTrader.Core.FloatingPoint; -using NinjaTrader.NinjaScript.DrawingTools; #endregion //This namespace holds Indicators in this folder and is required. Do not change it. @@ -70,11 +55,11 @@ namespace NinjaTrader.NinjaScript.Indicators { if (CurrentBar < 3) // Need at least 3 bars. { - Value[0] = Close[0]; + Value[0] = Input[0]; return; } - Value[0] = c1 * (Close[0] + Close[1]) / 2 + c2 * Value[1] + c3 * Value[2]; + Value[0] = c1 * (Input[0] + Input[1]) / 2 + c2 * Value[1] + c3 * Value[2]; } public override string DisplayName