Пример #1
0
            private IEnumerable <IMarketDataStorage <ExecutionMessage> > GetExecutionStorages()
            {
                var executionRegistry = _sessionStrategy.GetExecutionStorage();

                var securities = InteropHelper
                                 .GetDirectories(executionRegistry.DefaultDrive.Path)
                                 .Select(letterDir => new { letterDir, name = Path.GetFileName(letterDir) })
                                 .Where(t => t.name != null && t.name.Length == 1)
                                 .SelectMany(t => InteropHelper.GetDirectories(t.letterDir))
                                 .Select(p => Path.GetFileName(p).FolderNameToSecurityId())
                                 .Select(this.LookupById)
                                 .Where(s => s != null)
                                 .ToArray();

                return(securities.Select(s => executionRegistry.GetExecutionStorage(s, ExecutionTypes.Order)));
            }
Пример #2
0
                public StrategyEvents(SessionStrategy sessionStrategy, Action startTimer)
                {
                    if (sessionStrategy == null)
                    {
                        throw new ArgumentNullException(nameof(sessionStrategy));
                    }

                    if (startTimer == null)
                    {
                        throw new ArgumentNullException(nameof(startTimer));
                    }

                    _strategy        = sessionStrategy.Strategy;
                    _sessionStrategy = sessionStrategy;
                    _startTimer      = startTimer;

                    _executionRegistry = _sessionStrategy.GetExecutionStorage();

                    SubscribeEvents();
                }