Example #1
0
            public void PaintOrders(Graphics canvas, Rectangle rectPaint, decimal MaxPrice, decimal MinPrice, decimal minStepPrice)
            {
                int count = this.CollectionOrders.Count();

                if (count == 0)
                {
                    return;
                }

                foreach (var ord in this.CollectionOrders)
                {
                    var vol = ord.Volume < 0 ? ord.Volume * -1 : ord.Volume;
                    GraphicShape.PaintHLine(canvas, rectPaint, ord.Price, ord.Price + "(" + vol + ")",
                                            MaxPrice, MinPrice, ord.Volume > 0 ? Color.DarkGreen : Color.DarkRed, "left");
                }
            }
Example #2
0
        /// <summary>Отрисовка перекрестья</summary>
        /// <param name="coord"></param>
        void PaintCrossLines(Point coord, Candles.DataCandle candle)
        {
            if (candle.IsNull())
            {
                return;
            }
            string d    = candle.Candle.Time.Day.ToString();
            string m    = candle.Candle.Time.Month.ToString();
            string y    = candle.Candle.Time.Year.ToString();
            string min  = candle.Candle.Time.Minute.ToString();
            string hour = candle.Candle.Time.Hour.ToString();
            string time = (d.Length < 2 ? '0' + d : d) + "." + (m.Length < 2 ? '0' + m : m) + "." + y + " " +
                          (hour.Length < 2 ? '0' + hour : hour) + ":" + (min.Length < 2 ? '0' + min : min) + " (" + candle.Description + ")";
            //GraphicShape.PaintLine(this.Canvas, new Point(coord.X, 0), new Point(coord.X, 1000), Color.Black);
            decimal priceY = GraphicShape.GetValueFromCoordinate(this.RectAllTop.Height, this.MaxPrice, this.MinPrice, coord.Y, this.PanelPrices.CountFloat);

            GraphicShape.PaintVLine(this.Canvas, this.RectAllTop, time, new Point(coord.X, 0), new Point(coord.X, this.RectAllTop.Height), Color.Black);
            GraphicShape.PaintHLine(this.Canvas, this.RectAllTop, priceY, this.MaxPrice, this.MinPrice, Color.Black);
        }