コード例 #1
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="session"></param>
 public ResponseListener(O2GSession session)
 {
     mSession = session;
     mRequestID = string.Empty;
     mInstrument = string.Empty;
     mResponse = null;
     mSyncResponseEvent = new EventWaitHandle(false, EventResetMode.AutoReset);
     mOffers = new OfferCollection();
 }
コード例 #2
0
        private void ProcessOffer(OfferCollection offerCollection)
        {
            foreach (var currency in _runner.OfferData.Keys)
            {
                if (offerCollection.BuyingType == currency)
                {
                    continue;
                }
                var appraised    = offerCollection.Appraise(currency);
                var offers       = new List <Offer>(offerCollection.GetTrimmedOffers(currency));
                var nearestOffer = offers.MinBy(offer => Math.Abs((int)appraised - offer.Ratio)).First();

                var point = new RoutePoint(nearestOffer);
                _points.Add(point);
            }
        }
コード例 #3
0
 /// <summary>
 /// ctor
 /// </summary>
 public TableListener()
 {
     mOffers = new OfferCollection();
 }