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);
        }
예제 #2
0
 internal Graph(double requiredVolume, Quotes quotes)
 {
     m_bids = GraphPart.CreateBids(requiredVolume, quotes);
     m_asks = GraphPart.CreateAsks(requiredVolume, quotes);
 }