Esempio n. 1
0
        void Indicator_Checked(object sender, RoutedEventArgs e)
        {
            ChartTechnicalIndicator indicator = new ChartTechnicalIndicator();

            indicator.IndicatorType = IndicatorTypes.AccumulationDistribution;
            ser1.Indicators.Items.Add(indicator);
            ChartLayer layer = new ChartLayer();

            layer.LayerIndicatorName = "Accumulation Distribution";
            ChartAccumulationDistribution.SetSignalLineColor(ser1.Indicators.Items[ser1.Indicators.Items.Count - 1], Brushes.Red);

            ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.Background = this.Resources["transparentBackground"] as SolidColorBrush;
            ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.LineStroke            = this.Resources["linestroke"] as Pen;
            ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.IntersectAction       = ChartLabelIntersectAction.Hide;
            ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Shift;
            ChartArea.SetGridLineStroke(ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis, this.Resources["gridstroke"] as Pen);
            ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.OpposedPosition = true;
            ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.LabelTemplate   = this.Resources["YAxistemplate"] as DataTemplate;

            AddNotes(ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.Series[0], layer, 5);
            for (int i = 0; i < syncChart1.Areas.Count; i++)
            {
                SetHorizontalScale(syncChart1.Areas[i]);
            }
        }
Esempio n. 2
0
 void Window1_Checked1(object sender, RoutedEventArgs e)
 {
     if (reset.IsEnabled == false)
     {
         reset.IsEnabled = true;
     }
     ChartTechnicalIndicator indicator = new ChartTechnicalIndicator();
     indicator.IndicatorType = IndicatorTypes.AccumulationDistribution;
     ser1.Indicators.Items.Add(indicator);
     ChartAccumulationDistribution.SetSignalLineColor(ser1.Indicators.Items[ser1.Indicators.Items.Count - 1], new SolidColorBrush(Color.FromRgb(0x00,0xD3,0x0A)));                        
                     
         ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.LineStroke = this.Resources["pen1"] as Pen;
         ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.TickLineStroke = this.Resources["pen1"] as Pen;
         ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Shift;
         ChartArea.SetGridLineStroke(ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis, this.Resources["pen1"] as Pen);
         ser1.Indicators.Items[ser1.Indicators.Items.Count - 1].accumulationArea.SecondaryAxis.LabelForeground = this.Resources["gradient2"] as LinearGradientBrush;                        
               
     indicator.accumulationArea.Loaded += new RoutedEventHandler(accumulationArea_Loaded);
 }