Ejemplo n.º 1
0
        public PositionsManager()
        {
            service = Program.Container.Resolve <IServiceProvider>().GetRequiredService <IMessagingService>();

            xtrade     = Program.Container.Resolve <IMainService>();
            todayDeals = new Dictionary <long, DealInfo>();
            terminals  = new Dictionary <long, Terminal>();
            todayStat  = new TodayStat();
            fillRiskProps();
            loadPositions();

            foreach (object t in (List <object>)xtrade.GetObjects(EntitiesEnum.Terminal))
            {
                Terminal term = (Terminal)t;
                if (term.Retired)
                {
                    continue;
                }
                terminals.Add(term.AccountNumber, term);
                if (term.Retired == false)
                {
                    var acc = new Account();
                    acc.Number     = term.AccountNumber;
                    acc.TerminalId = term.Id;
                    todayStat.Accounts.Add(acc);
                }
            }
        }
Ejemplo n.º 2
0
 public PositionsManager()
 {
     positions  = new ConcurrentDictionary <long, PositionInfo>();
     Clients    = GlobalHost.ConnectionManager.GetHubContext <TerminalsHub>().Clients;
     xtrade     = Program.Container.Resolve <IMainService>();
     todayDeals = new Dictionary <long, DealInfo>();
     terminals  = new Dictionary <long, Terminal>();
     todayStat  = new TodayStat();
     fillRiskProps();
     foreach (var term in xtrade.GetTerminals())
     {
         terminals.Add(term.AccountNumber, term);
         if (term.Disabled == false)
         {
             var acc = new Account();
             acc.Number     = term.AccountNumber;
             acc.TerminalId = term.Id;
             todayStat.Accounts.Add(acc);
         }
     }
 }