public override void OnStateChange(IndicatorState state) { if (state == IndicatorState.Configure) { _lenght = CreateParameterInt("Length", 21); _deviation = CreateParameterDecimal("Deviation", 2); _seriesUp = CreateSeries("Up line", Color.Green, IndicatorChartPaintType.Line, true); _seriesCenter = CreateSeries("Centre line", Color.Green, IndicatorChartPaintType.Line, false); _seriesDown = CreateSeries("Down line", Color.Green, IndicatorChartPaintType.Line, true); _sma = IndicatorsFactory.CreateIndicatorByName("Sma", Name + "Sma", false); ((IndicatorParameterInt)_sma.Parameters[0]).Bind(_lenght); ProcessIndicator("Central SMA", _sma); } }
public override void OnStateChange(IndicatorState state) { if (state == IndicatorState.Configure) { _period = CreateParameterInt("Lenght", 100); _candlePoint = CreateParameterStringCollection("Candle Point", "Close", Entity.CandlePointsArray); _upDeviation = CreateParameterDecimal("Up channel deviation", 2); _downDeviation = CreateParameterDecimal("Down channel deviation", -2); _seriesUpperband = CreateSeries("Up channel", Color.Aqua, IndicatorChartPaintType.Line, true); _seriesUpperband.CanReBuildHistoricalValues = true; _seriesCentralLine = CreateSeries("Regression Line ", Color.Gold, IndicatorChartPaintType.Line, true); _seriesCentralLine.CanReBuildHistoricalValues = true; _seriesLowerband = CreateSeries("Down channel", Color.OrangeRed, IndicatorChartPaintType.Line, true); _seriesLowerband.CanReBuildHistoricalValues = true; } }
public override void OnStateChange(IndicatorState state) { if (state == IndicatorState.Configure) { _af = CreateParameterDecimal("Step", (decimal)0.02); _maxAf = CreateParameterDecimal("MaxStep", (decimal)0.2); _series = CreateSeries("ParabolicSAR", Color.DodgerBlue, IndicatorChartPaintType.Point, true); _series.CanReBuildHistoricalValues = false; } else if (state == IndicatorState.Dispose) { if (_valuesUp != null) { _valuesUp.Clear(); } if (_valuesDown != null) { _valuesDown.Clear(); } } }