示例#1
0
 private MarketListener(BetfairClient client, 
     PriceProjection priceProjection, 
     int connectionCount)
 {
     this.client = client;
     this.priceProjection = priceProjection;
     this.connectionCount = connectionCount;
     Task.Run(() => PollMarketBooks());
 }
示例#2
0
        public static MarketListener Create(BetfairClient client, 
            PriceProjection priceProjection, 
            int connectionCount, int samplePeriod = 0)
        {
            if (listener == null)
                listener = new MarketListener(client, priceProjection, connectionCount, samplePeriod);

            return listener;
        }
        private MarketListenerPeriodic(BetfairClient client,
            PriceProjection priceProjection,
            double periodInSec)
        {
            _client = client;
            _priceProjection = priceProjection;

            _polling = Observable.Interval(TimeSpan.FromSeconds(periodInSec),
                                          NewThreadScheduler.Default).Subscribe(l => DoWork());
        }
示例#4
0
 private MarketListener(BetfairClient client, 
     PriceProjection priceProjection, 
     int connectionCount, int samplePeriod)
 {
     this.client = client;
     this.priceProjection = priceProjection;
     this.connectionCount = connectionCount;
     this.samplePeriod = samplePeriod;
     if (samplePeriod >= 1000)
         this.sampleFrequency = samplePeriod/1000;
     else
         this.sampleFrequency = samplePeriod/100;
     Task.Run(() => PollMarketBooks());
 }
 public BetfairServerResponse<List<MarketBook>> ListMarketBook(
     IEnumerable<string> marketIds,
     PriceProjection priceProjection = null,
     OrderProjection? orderProjection = null,
     MatchProjection? matchProjection = null)
 {
     return client.ListMarketBook(
         marketIds,
         priceProjection,
         orderProjection,
         matchProjection).Result;
 }
 public static MarketListenerMultiPeriod Create(BetfairClient client,
     PriceProjection priceProjection)
 {
     return new MarketListenerMultiPeriod(client, priceProjection);
 }
 private MarketListenerMultiPeriod(BetfairClient client,
     PriceProjection priceProjection)
 {
     _client = client;
     _priceProjection = priceProjection;
 }
 public static MarketListenerPeriodic Create(BetfairClient client,
     PriceProjection priceProjection,
     double periodInSec)
 {
     return new MarketListenerPeriodic(client, priceProjection, periodInSec);
 }