public PriceGenerator(IInstrumentFactory instrumentFactory, string name)
 {
     _sourceName  = name;
     _instruments = instrumentFactory.CreateInstruments().ToList();
     _observers   = new List <IObserver <InstrumentData> >();
     _timer       = new Timer(PublishPrices, null, -1, -1);
     _random      = new Random();
 }
        public CompositePriceSource(IInstrumentFactory instrumentFactory,
                                    IProvidePriceGenerator priceGeneratorProvider)
        {
            _instruments   = instrumentFactory.CreateInstruments().ToList();
            _subscriptions = new Dictionary <string, List <Subscription> >();

            // creating two price generator
            _arcaPriceGenerator = priceGeneratorProvider.CreatePriceGenerator("ARCA");
            _nsdqPriceGenerator = priceGeneratorProvider.CreatePriceGenerator("NSDQ");
        }