コード例 #1
0
 public static void UpdateStatSeriesDefinition(this PriceVolumeChart chart, StockStat stat)
 {
     for (int i = 0; i < stat.DataCount; i++)
     {
         Series s = chart.GetSeries(stat.ChartSeriesName(i));
         s.Color = stat.DataColor[i];
     }
 }
コード例 #2
0
 public static void AddPositionsAnnotations(this PriceVolumeChart chart, List <Position> positions)
 {
     chart.PVChartControl.Annotations.Clear();
     foreach (var position in positions)
     {
         AddPositionAnnotation(chart, position);
     }
 }
コード例 #3
0
 public static void PrependStockStatData(this PriceVolumeChart chart, StockPricesData data, StockStat stat)
 {
     for (int i = 0; i < stat.DataCount; i++)
     {
         Series s = chart.GetSeries(stat.ChartSeriesName(i));
         s.Points.Clear();
     }
     AppendStockStatData(chart, data, stat);
 }
コード例 #4
0
        public static void PrependStockData(this PriceVolumeChart chart, StockPricesData data)
        {
            for (int i = 0; i < data.Length; i++)
            {
                chart.PricesCandles.Points.InsertXY(i, data.TS[i], data.H[i]);
                chart.PricesCandles.Points[i].YValues[1] = data.L[i];
                chart.PricesCandles.Points[i].YValues[2] = data.O[i];
                chart.PricesCandles.Points[i].YValues[3] = data.C[i];

                chart.PricesLine.Points.InsertXY(i, data.TS[i], data.C[i]);
                chart.Volume.Points.InsertXY(i, data.TS[i], data.V[i]);
            }
        }
コード例 #5
0
 public static void AppendStockStatData(this PriceVolumeChart chart, StockPricesData data, StockStat stat)
 {
     for (int i = 0; i < stat.DataCount; i++)
     {
         Series  s            = chart.GetSeries(stat.ChartSeriesName(i));
         float[] currdata     = stat.Data(i);
         int     tsstartindex = data.Length - currdata.Length;
         for (int j = 0; j < tsstartindex; j++)
         {
             int ix = s.Points.AddXY(data.TS[j], 0);
             s.Points[ix].IsEmpty = true;
         }
         for (int j = 0; j < currdata.Length; j++)
         {
             s.Points.AddXY(data.TS[tsstartindex + j], currdata[j]);
         }
     }
 }
コード例 #6
0
        private static void AddAnnotation(PriceVolumeChart chart, int imageIndex, PositionDir dir, DateTime ts)
        {
            DataPoint dataPoint = chart.PricesCandles.Points.FindByValue(ts.ToOADate(), "X");

            if (dataPoint == null)
            {
                return;
            }

            ImageAnnotation annotation = new ImageAnnotation()
            {
                AnchorDataPoint = dataPoint,
                AnchorY         = dataPoint.YValues[PositionOpenCloseImages.AnnotationAnchorYValueIndex[dir][imageIndex]],
                AnchorAlignment = PositionOpenCloseImages.AnnotationContentAlignment[dir][imageIndex],
                Image           = PositionOpenCloseImages.ImageName[dir][imageIndex],
                AnchorOffsetY   = 2
            };

            chart.PVChartControl.Annotations.Add(annotation);
        }
コード例 #7
0
 public static void LoadStockData(this PriceVolumeChart chart, StockPricesData data)
 {
     ClearStockData(chart);
     AppendStockData(chart, data);
 }
コード例 #8
0
 public static void ClearStockData(this PriceVolumeChart chart)
 {
     chart.ClearAllSeriesData();
 }
コード例 #9
0
 private static void AddPositionAnnotation(PriceVolumeChart chart, Position position)
 {
     AddAnnotation(chart, PositionOpenCloseImages.IndexOpen, position.Direction, position.TSOpen);
     AddAnnotation(chart, PositionOpenCloseImages.IndexClose, position.Direction, position.TSClose);
 }