Пример #1
0
        /// <summary> Рисует уровни </summary>
        /// <param name="canvas"></param>
        public void PaintByCandle(CandleInfo candle)
        {
            //this.Panel.Clear();
            if (candle.Index >= CollectionLevels.Count)
            {
                return;
            }
            var canvas = this.Panel.GetGraphics;

            //this.AllDataLevels.Clear();

            if (this.CollectionLevels.IsNull())
            {
                return;
            }
            if (candle.Index == 0)
            {
                Values.Paint(this.Max, this.Min);
                Values.Panel.Paint(canvas);
            }

            var level = CollectionLevels.ElementAt(candle.Index);

            if (level.NotIsNull())
            {
                this.PaintOneLevel(canvas, level, candle);
            }
            (new Line()).Paint(canvas, new Point(Panel.Rect.X, Panel.Rect.Y), new Point(Panel.Rect.X + Panel.Rect.Width, Panel.Rect.Y), Color.Black);
        }
Пример #2
0
        public bool PaintLast(CandleInfo candle)
        {
            PanelLast.Clear();
            if (CollectionLevels.IsNull() || this.CollectionLevels.Count == 0)
            {
                return(false);
            }
            var canvas = PanelLast.GetGraphics;
            var level  = this.CollectionLevels.ElementAt(0);

            if (level.NotIsNull())
            {
                if (level.Volume > this.Max || level.Volume < this.Min)
                {
                    if (this.OnReachLimitValues.NotIsNull())
                    {
                        this.OnReachLimitValues(level.Volume, this.Max, this.Min);
                    }
                    return(false);
                }
                else
                {
                    PaintOneLevel(canvas, level, candle, true);
                    Values.PaintCurrentValue(level.Volume, this.Max, this.Min);
                    Values.PanelCurValue.Paint(canvas);
                }
            }
            return(true);
        }
Пример #3
0
        public Chart GetFirstLevel()
        {
            var elem = CollectionLevels.ElementAt(0);

            return(elem.NotIsNull() ? elem : null);
        }