コード例 #1
0
 public PriceFeedSimulator(
     ICurrencyPairRepository currencyPairRepository,
     IPricePublisher pricePublisher,
     IPriceLastValueCache priceLastValueCache)
 {
     _currencyPairRepository = currencyPairRepository;
     _pricePublisher         = pricePublisher;
     _priceLastValueCache    = priceLastValueCache;
     _random = new Random(_currencyPairRepository.GetHashCode());
 }
コード例 #2
0
 public PriceFeedSimulator(
     ICurrencyPairRepository currencyPairRepository,
     IPricePublisher pricePublisher,
     IPriceLastValueCache priceLastValueCache)
 {
     _currencyPairRepository = currencyPairRepository;
     _pricePublisher = pricePublisher;
     _priceLastValueCache = priceLastValueCache;
     _random = new Random(_currencyPairRepository.GetHashCode());
 }
コード例 #3
0
        public MainViewModel(
            IPricePublisher pricePublisher, 
            IPriceFeed priceFeed, 
            ICurrencyPairRepository currencyPairRepository, 
            Func<CurrencyPairInfo, ICurrencyPairViewModel> ccyViewModelFactory)
        {
            _pricePublisher = pricePublisher;
            _priceFeed = priceFeed;
            _currencyPairRepository = currencyPairRepository;
            _ccyViewModelFactory = ccyViewModelFactory;

            StartStopCommand = new DelegateCommand(StartStopServer);
            CurrencyPairs = new ObservableCollection<ICurrencyPairViewModel>();

            ObserveThroughputs();
        }
コード例 #4
0
        public MainViewModel(
            IPricePublisher pricePublisher,
            IPriceFeed priceFeed,
            ICurrencyPairRepository currencyPairRepository,
            Func <CurrencyPairInfo, ICurrencyPairViewModel> ccyViewModelFactory)
        {
            _pricePublisher         = pricePublisher;
            _priceFeed              = priceFeed;
            _currencyPairRepository = currencyPairRepository;
            _ccyViewModelFactory    = ccyViewModelFactory;

            StartStopCommand = new DelegateCommand(StartStopServer);
            CurrencyPairs    = new ObservableCollection <ICurrencyPairViewModel>();

            ObserveThroughputs();
        }
コード例 #5
0
        public PriceServerConsole(string ip, int port)
        {
            //m_pubsub = new RedisIQFeed(ip, port);
            m_pubsub = new ZmqIQFeed();
            m_pubsub.StartPricePublisher(ip, port);
            //m_pubsub.SubscribePriceUpdates();
            //m_pubsub.OnSubscriberReceive += M_subscriber_Receive;

            //m_publisher = new ZMQPublisher();
            //m_subscriber = new ZMQSubscriber();
            //m_subscriberClientTask = Task.Factory.StartNew(() => m_subscriber.SubscriptionLoop());

            //Task.Run(() => DisplaySubs());

            // Load symbols and spread formulas (and subscribe to these symbols)
            ReloadSymbols();
            ReloadSpreads();
        }
コード例 #6
0
        public MarketDataViewModel(IPricePublisher pricePublisher, IPriceSource priceSource, IReferenceData referenceData)
        {
            _dispatcher     = Dispatcher.CurrentDispatcher;
            _pricePublisher = pricePublisher;
            _priceSource    = priceSource;
            _referenceData  = referenceData;

            Filter = FilterRow;

            RefreshPricesCmd = new DelegateCommand((object param) => RefreshPrices());
            LivePricesCmd    = new DelegateCommand((object param) => ConfigureLivePriceUpdates());

            foreach (var security in _referenceData.GetSecurities())
            {
                _securityPrices.Add(new SecurityDataViewModel(security));
            }

            RefreshPrices();
        }
コード例 #7
0
 public PriceFeed(IPricePublisher pricePublisher)
 {
     this._pricePublisher = pricePublisher;
 }