Esempio n. 1
0
        private void DrawPolyLineInternal(StrategyPolyLine polyLine)
        {
            IList <float>       line      = polyLine.Prices;
            Color               color     = polyLine.Color;
            PriceRectangle      priceRect = mapping.PriceRect;
            int                 start     = priceRect.StartIndex;
            int                 end       = priceRect.EndIndex + 1;
            PriceShape_PolyLine polyline  = new PriceShape_PolyLine();

            for (int index = start; index <= end; index++)
            {
                if (index >= line.Count)
                {
                    return;
                }
                if (index < 0)
                {
                    continue;
                }
                float price = line[index];
                if (price == float.MinValue)
                {
                    continue;
                }
                PriceShape_Point point = new PriceShape_Point(index, price);
                polyline.AddPoint(point);
            }
            polyline.Color = color;
            DrawShape(polyline);
        }
Esempio n. 2
0
        public void Paint(Graphics g, PriceGraphicMapping priceGraphic, IPriceShape shape)
        {
            PriceShape_PolyLine line = (PriceShape_PolyLine)shape;

            PointF[] points = new PointF[line.Points.Count];
            for (int i = 0; i < line.Points.Count; i++)
            {
                points[i] = GetPointF(priceGraphic, line.Points[i]);
            }
            g.DrawLines(new Pen(line.Color, line.Width), points);
        }
Esempio n. 3
0
        private static PriceShape_PolyLine GetPolyLine()
        {
            PriceShape_PolyLine polyLine = new PriceShape_PolyLine();

            polyLine.Width = 2;
            polyLine.Color = Color.White;
            polyLine.AddPoint(new PricePoint(1, 3));
            polyLine.AddPoint(new PricePoint(2, 31));
            polyLine.AddPoint(new PricePoint(3, 55));
            polyLine.AddPoint(new PricePoint(4, 13));
            polyLine.AddPoint(new PricePoint(5, 34));
            polyLine.AddPoint(new PricePoint(6, 41));
            return(polyLine);
        }
Esempio n. 4
0
        private void bt_DrawLine_Click(object sender, EventArgs e)
        {
            CompChartData       chartData = this.compChart1.CompChartData;
            IKLineData          klineData = chartData.CurrentRealTimeDataReader.GetKLineData(new data.KLinePeriod(data.KLineTimeType.MINUTE, 1));
            PriceShape_PolyLine polyLine  = new PriceShape_PolyLine();

            for (int i = 0; i < klineData.Length; i++)
            {
                PriceShape_Point point = new PriceShape_Point();
                point.X = i;
                point.Y = klineData.Arr_End[i];
                polyLine.Points.Add(point);
            }
            polyLine.Color = Color.GreenYellow;
            //this.compChart1.Drawer_Candle.Drawer_Chart.DrawPriceShape(polyLine);
            //this.compChart1.Drawer_Candle.Paint();
        }
Esempio n. 5
0
 public void DrawPolyLine(PriceShape_PolyLine polyLine)
 {
     RecordShape(polyLine);
 }
 public void DrawPolyLine(PriceShape_PolyLine polyLine)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// 画折线
 /// 该方法在指定点画折线,适用于在图形上画直线
 /// 如Zigzag、通道线、趋势线等。
 /// </summary>
 /// <param name="polyLine"></param>
 /// <param name="color"></param>
 public void DrawPolyLine(PriceShape_PolyLine polyLine)
 {
     this.strategyGraphic.Shapes.AddPriceShape(polyLine);
 }