Esempio n. 1
0
 private void LinkMarkets(
     MarketCache market, CancellationToken cancellationToken)
 {
     _strategies.ForEach(s => s.LinkToMarket(market));
     _strategies.ForEach(s => s.WithCancellationToken(cancellationToken));
     _orderManager.LinkToMarket(market);
 }
Esempio n. 2
0
 public static double Overround(this MarketCache market)
 {
     if (market is null)
     {
         return(0);
     }
     if (!market.Runners.Any())
     {
         return(0);
     }
     return(market.Runners.Sum(r =>
     {
         if (r.Value.BestAvailableToBack.Price(0) <= 0)
         {
             return 0;
         }
         return 1 / r.Value.BestAvailableToBack.Price(0);
     }));
 }
Esempio n. 3
0
 public void LinkToMarket(MarketCache marketCache)
 {
     Market = marketCache;
 }
Esempio n. 4
0
 private static void UpdateMarketCache(ChangeMessage change, MarketCache market)
 {
     market.OnChange(change);
 }