I have a modified version of default Darvas indicator for sharing here. But I have a minor issue before posting it.
I am using a bool = false condition for painting the region gradient color. The indicator plots fine when the bool is set to false. However, when bool condition is set to true the indicator does not plot. The following is the logic.
if (paintRegion) { LinearGradientBrush gradient = new LinearGradientBrush(); gradient.StartPoint = new Point( 0, 0 ); gradient.EndPoint = new Point( 1, 0 ); gradient.GradientStops.Add(new GradientStop(System.Windows.Media.Colors.Crimson, 0)); //Color for Bottom side of the candle gradient.GradientStops.Add(new GradientStop(System.Windows.Media.Colors.DarkCyan, 1)); //Color for Top side of the candle Draw.Region(this, "Region1", CurrentBar, 0, boxTopSeries, boxBottomSeries, Brushes.Transparent, gradient, Zopacity,0); gradient.Freeze(); }
Many Thanks.
Comment