Пример #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);
        }
Пример #2
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);
        }