internal static GraphPart CreateBids(double requiredVolume, Quotes quotes) { GraphPart result = new GraphPart(quotes); List<Point2F> points = result.m_points; long now = quotes.Time; foreach (var element in quotes.Items) { Point2F point = new Point2F(); point.X = (element.Time - now) / 1000.0F; point.Y = MathEx.CalculateWAVP(requiredVolume, element.Quote.Bids); points.Add(point); } if (0 == quotes.Items.Count) { quotes.Items.Clear(); } QuoteEx quote = quotes.Last; if (null != quote.Quote) { Point2F point = new Point2F(); point.X = (quote.Time - now) / 1000.0F; if (point.X < - quotes.Interval) { point.X = -(float)quotes.Interval; } point.Y = MathEx.CalculateWAVP(requiredVolume, quote.Quote.Bids); points.Add(point); } return result; }
internal static GraphPart CreateAsks(double requiredVolume, Quotes quotes) { GraphPart result = new GraphPart(quotes); List <Point2F> points = result.m_points; long now = quotes.Time; foreach (var element in quotes.Items) { Point2F point = new Point2F(); point.X = (element.Time - now) / 1000.0F; point.Y = MathEx.CalculateWAVP(requiredVolume, element.Quote.Asks); points.Add(point); } QuoteEx quote = quotes.Last; if (null != quote.Quote) { Point2F point = new Point2F(); point.X = (quote.Time - now) / 1000.0F; if (point.X < -quotes.Interval) { point.X = -(float)quotes.Interval; } point.Y = MathEx.CalculateWAVP(requiredVolume, quote.Quote.Asks); points.Add(point); } return(result); }
internal Graph(double requiredVolume, Quotes quotes) { m_bids = GraphPart.CreateBids(requiredVolume, quotes); m_asks = GraphPart.CreateAsks(requiredVolume, quotes); }
internal Graph(double requiredVolume, Quotes quotes) { m_bids = GraphPart.CreateBids(requiredVolume, quotes); m_asks = GraphPart.CreateAsks(requiredVolume, quotes); }