Ejemplo n.º 1
0
        /// <summary> Отрисовывет свечи</summary>
        /// <param name="canvas"></param>
        /// <param name="rectPaint"></param>
        /// <param name="MaxPrice"></param>
        /// <param name="MinPrice"></param>
        /// <param name="minStepPrice"></param>
        public void PaintCandles(Graphics canvas, Rectangle rectPaint, decimal MaxPrice, decimal MinPrice, decimal minStepPrice)
        {
            if (this.CountPaintCandle == 0)
            {
                return;
            }

            this.WidthOneCandle = GetWidthOne(rectPaint);

            //Событие перед отрисовкой
            if (!OnBeforePaintCandle.IsNull())
            {
                OnBeforePaintCandle(null);
            }

            List <MarketObject.Chart> HVolume = new List <MarketObject.Chart>();
            int index = 1;

            CollectionCandle.ForEach <CandleLib.CandleData>((candleData) =>
            {
                this.PaintOneCandle(canvas, rectPaint, candleData, index, MaxPrice, MinPrice);
                index++;
            });

            if (!OnPaintedCandles.IsNull())
            {
                OnPaintedCandles();
            }
        }
Ejemplo n.º 2
0
        /// <summary> Отрисовывет свечи</summary>
        /// <param name="canvas"></param>
        /// <param name="rectPaint"></param>
        public void PaintCandles()
        {
            if (CountPaintCandle == 0)
            {
                return;
            }
            Panel.Params.WidthCandle = GetWidthOne();

            Panel.Clear();
            var canvas = Panel.GetGraphics;

            AllDataPaintedCandle.Clear();

            MaxValues = new MaxData();

            //Событие перед отрисовкой
            if (!OnBeforePaintCandle.IsNull())
            {
                OnBeforePaintCandle();
            }

            List <Chart> HVolume = new List <Chart>();
            int          index   = 1;

            Count = CollectionCandle.Count();
            CollectionCandle.ForEach <CandleData>((candleData) =>
            {
                if (OnEachCandle.NotIsNull())
                {
                    OnEachCandle(index - 1, candleData, Count);
                }
                if (index <= CountPaintCandle)
                {
                    var lastPCan = PaintOneCandle(canvas, Panel, candleData, index, index > 1 ? true : false);
                    if (OnEachPaintedCandle.NotIsNull())
                    {
                        if (index == 1)
                        {
                            lastPCan.First = true;
                        }
                        if (index == CountPaintCandle)
                        {
                            lastPCan.Last = true;
                        }
                        OnEachPaintedCandle(lastPCan);
                    }
                }
                index++;
            });

            if (!OnPaintedCandles.IsNull())
            {
                OnPaintedCandles();
            }
        }