private void OnGraphUpdate(PriceDTO val)
        {
            var item = new GraphItem { Value = (double)val.Price, Time = val.TickDate };
            var key = val.MarketId.ToString();

            PriceGraph.AddItem(key, item);
            PriceGraphSingle.AddItem(key, item);
        }
        public void AddItem(string key, GraphItem item)
        {
            var graph = GetGraph(key);

            var valFraction = graph.ValueToFraction(item.Value);
            if (_settings.UpdateValueScale(valFraction))
                RebuildLines();

            graph.Add(item);
        }
Ejemplo n.º 3
0
        public void Add(GraphItem item)
        {
            Items.Add(item);
            if (Items.Count == 1) // need at least two points to make a line
                Items.Add(item);

            AddNewLine(Items.Count - 1);

            Validate();
        }
        private void OnGraphUpdate(PriceDTO val)
        {
            var item = new GraphItem {
                Value = (double)val.Price, Time = val.TickDate
            };
            var key = val.MarketId.ToString();

            PriceGraph.AddItem(key, item);
            PriceGraphSingle.AddItem(key, item);
        }
Ejemplo n.º 5
0
        Line CreateLine(GraphItem prev, GraphItem newItem)
        {
            var first = Items.First();

            var offset     = _startOffset + GetDistance(first, newItem);
            var prevOffset = _startOffset + GetDistance(first, prev);

            var line = CreateLine(prev.Value, newItem.Value, prevOffset, offset);

            return(line);
        }
Ejemplo n.º 6
0
        public void Add(GraphItem item)
        {
            Items.Add(item);
            if (Items.Count == 1)             // need at least two points to make a line
            {
                Items.Add(item);
            }

            AddNewLine(Items.Count - 1);

            Validate();
        }
        public void AddItem(string key, GraphItem item)
        {
            var graph = GetGraph(key);

            var valFraction = graph.ValueToFraction(item.Value);

            if (_settings.UpdateValueScale(valFraction))
            {
                RebuildLines();
            }

            graph.Add(item);
        }
        private void OnGraphUpdate(PriceDTO val)
        {
            // NOTE this code is a temporary workaround until datetime bug is fixed
            var ticksString = val.TickDate.Substring(7, val.TickDate.Length - 10);
            var time        = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddMilliseconds(Int64.Parse(ticksString));

            var item = new GraphItem {
                Value = (double)val.Price, Time = time
            };
            var key = val.MarketId.ToString();

            PriceGraph.AddItem(key, item);
            PriceGraphSingle.AddItem(key, item);
        }
Ejemplo n.º 9
0
 private double GetDistance(GraphItem val1, GraphItem val2)
 {
     return((val2.Time - val1.Time).TotalSeconds * _settings.TimeScale);
 }
		private void OnGraphUpdate(PriceDTO val)
		{
			// NOTE this code is a temporary workaround until datetime bug is fixed
			var ticksString = val.TickDate.Substring(7, val.TickDate.Length - 10);
			var time = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddMilliseconds(Int64.Parse(ticksString));

			var item = new GraphItem { Value = (double)val.Price, Time = time };
			var key = val.MarketId.ToString();

			PriceGraph.AddItem(key, item);
			PriceGraphSingle.AddItem(key, item);
		}
Ejemplo n.º 11
0
 private double GetDistance(GraphItem val1, GraphItem val2)
 {
     return (val2.Time - val1.Time).TotalSeconds * _settings.TimeScale;
 }
Ejemplo n.º 12
0
        Line CreateLine(GraphItem prev, GraphItem newItem)
        {
            var first = Items.First();

            var offset = _startOffset + GetDistance(first, newItem);
            var prevOffset = _startOffset + GetDistance(first, prev);

            var line = CreateLine(prev.Value, newItem.Value, prevOffset, offset);

            return line;
        }