Ejemplo n.º 1
0
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is MovingAverageConvergenceDivergence macd)
            {
                macd.LongPeriod            = LongPeriod;
                macd.ShortPeriod           = ShortPeriod;
                macd.SignalSmoothingPeriod = SignalSmoothingPeriod;
                if (ValueLevel.HasValue)
                {
                    macd.ValueLevel = (DevExpress.XtraCharts.ValueLevel)ValueLevel.Value;
                }

                var signalLineColor = Utils.ColorFromString(SignalLineColor);
                if (signalLineColor != System.Drawing.Color.Empty)
                {
                    macd.SignalLineColor = signalLineColor;
                }

                if (SignalLineDashStyle.HasValue)
                {
                    macd.SignalLineStyle.DashStyle = SignalLineDashStyle.Value;
                }
                if (SignalLineJoin.HasValue)
                {
                    macd.SignalLineStyle.LineJoin = SignalLineJoin.Value;
                }
                if (SignalLineThickness.HasValue)
                {
                    macd.SignalLineStyle.Thickness = SignalLineThickness.Value;
                }
            }
        }
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is BollingerBands bollingerBands)
            {
                var bandsColor = Utils.ColorFromString(BandsColor);
                if (bandsColor != System.Drawing.Color.Empty)
                {
                    bollingerBands.BandsColor = bandsColor;
                }

                if (BandsDashStyle.HasValue)
                {
                    bollingerBands.BandsLineStyle.DashStyle = BandsDashStyle.Value;
                }
                if (BandsJoin.HasValue)
                {
                    bollingerBands.BandsLineStyle.LineJoin = BandsJoin.Value;
                }
                if (BandsThickness.HasValue)
                {
                    bollingerBands.BandsLineStyle.Thickness = BandsThickness.Value;
                }

                bollingerBands.PointsCount = PointsCount;
                bollingerBands.StandardDeviationMultiplier = StandardDeviationMultiplier;

                if (ValueLevel.HasValue)
                {
                    bollingerBands.ValueLevel = (DevExpress.XtraCharts.ValueLevel)ValueLevel.Value;
                }
            }
        }
Ejemplo n.º 3
0
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is MovingAverage movingAverage)
            {
                var envelopeColor = Utils.ColorFromString(EnvelopeColor);
                if (envelopeColor != System.Drawing.Color.Empty)
                {
                    movingAverage.EnvelopeColor = envelopeColor;
                }

                if (EnvelopeDashStyle.HasValue)
                {
                    movingAverage.EnvelopeLineStyle.DashStyle = EnvelopeDashStyle.Value;
                }
                if (EnvelopeJoin.HasValue)
                {
                    movingAverage.EnvelopeLineStyle.LineJoin = EnvelopeJoin.Value;
                }
                if (EnvelopeThickness.HasValue)
                {
                    movingAverage.EnvelopeLineStyle.Thickness = EnvelopeThickness.Value;
                }

                if (Kind.HasValue)
                {
                    movingAverage.Kind = (DevExpress.XtraCharts.MovingAverageKind)Kind.Value;
                }
            }
        }
Ejemplo n.º 4
0
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is FibonacciIndicator fibonacciIndicator)
            {
                fibonacciIndicator.Kind = (DevExpress.XtraCharts.FibonacciIndicatorKind)Kind;

                var baseLevelColor = Utils.ColorFromString(BaseLevelColor);
                if (baseLevelColor != System.Drawing.Color.Empty)
                {
                    fibonacciIndicator.BaseLevelColor = baseLevelColor;
                }

                if (BaseLevelLineDashStyle.HasValue)
                {
                    fibonacciIndicator.LineStyle.DashStyle = BaseLevelLineDashStyle.Value;
                }
                if (BaseLevelLineJoin.HasValue)
                {
                    fibonacciIndicator.LineStyle.LineJoin = BaseLevelLineJoin.Value;
                }
                if (BaseLevelLineThickness.HasValue)
                {
                    fibonacciIndicator.LineStyle.Thickness = BaseLevelLineThickness.Value;
                }

                fibonacciIndicator.Label.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;

                var baseLevelTextColor = Utils.ColorFromString(BaseLevelTextColor);
                if (baseLevelColor != System.Drawing.Color.Empty)
                {
                    fibonacciIndicator.Label.BaseLevelTextColor = baseLevelTextColor;
                }

                var labelFont = Utils.StringToFont(LabelFont, out System.Drawing.Color labelTextColor);
                if (labelFont != null)
                {
                    fibonacciIndicator.Label.Font = labelFont;
                }
                if (labelTextColor != System.Drawing.Color.Empty)
                {
                    fibonacciIndicator.Label.TextColor = labelTextColor;
                }

                if (LabelVisible.HasValue)
                {
                    fibonacciIndicator.Label.Visible = LabelVisible.Value;
                }

                fibonacciIndicator.ShowAdditionalLevels = !HideAdditionalLevels;
                fibonacciIndicator.ShowLevel0           = !HideLevel0;
                fibonacciIndicator.ShowLevel100         = !HideLevel100;
                fibonacciIndicator.ShowLevel23_6        = !HideLevel23_6;
                fibonacciIndicator.ShowLevel76_4        = !HideLevel76_4;
            }
        }
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is SingleLevelIndicator singleLevelIndicator)
            {
                if (ValueLevel.HasValue)
                {
                    singleLevelIndicator.ValueLevel = (DevExpress.XtraCharts.ValueLevel)ValueLevel.Value;
                }
            }
        }
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is TripleExponentialMovingAverageTrix trix)
            {
                trix.PointsCount = PointsCount;
                if (ValueLevel.HasValue)
                {
                    trix.ValueLevel = (DevExpress.XtraCharts.ValueLevel)ValueLevel.Value;
                }
            }
        }
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is RateOfChange rateOfChange)
            {
                rateOfChange.PointsCount = PointsCount;
                if (ValueLevel.HasValue)
                {
                    rateOfChange.ValueLevel = (DevExpress.XtraCharts.ValueLevel)ValueLevel.Value;
                }
            }
        }
Ejemplo n.º 8
0
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is RelativeStrengthIndex rsi)
            {
                rsi.PointsCount = PointsCount;
                if (ValueLevel.HasValue)
                {
                    rsi.ValueLevel = (DevExpress.XtraCharts.ValueLevel)ValueLevel.Value;
                }
            }
        }
Ejemplo n.º 9
0
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is DetrendedPriceOscillator detrendedPriceOscillator)
            {
                detrendedPriceOscillator.PointsCount = PointsCount;
                if (ValueLevel.HasValue)
                {
                    detrendedPriceOscillator.ValueLevel = (DevExpress.XtraCharts.ValueLevel)ValueLevel.Value;
                }
            }
        }
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is ErrorBars errorBars)
            {
                if (Direction.HasValue)
                {
                    errorBars.Direction = (DevExpress.XtraCharts.ErrorBarDirection)Direction.Value;
                }

                if (EndStyle.HasValue)
                {
                    errorBars.EndStyle = (DevExpress.XtraCharts.ErrorBarEndStyle)EndStyle.Value;
                }
            }
        }
        protected internal override void SetupXtraChartIndicator(SCChart chart, DevExpress.XtraCharts.Indicator indicator)
        {
            base.SetupXtraChartIndicator(chart, indicator);

            if (indicator is FinancialIndicator financialIndicator)
            {
                financialIndicator.Point1.Argument = Point1Argument;
                if (Point1ValueLevel.HasValue)
                {
                    financialIndicator.Point1.ValueLevel = (DevExpress.XtraCharts.ValueLevel)Point1ValueLevel.Value;
                }
                financialIndicator.Point2.Argument = Point2Argument;
                if (Point2ValueLevel.HasValue)
                {
                    financialIndicator.Point2.ValueLevel = (DevExpress.XtraCharts.ValueLevel)Point2ValueLevel.Value;
                }
            }
        }