/// <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(); }
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); } }
/// <summary> /// ctor /// </summary> public TableListener() { mOffers = new OfferCollection(); }