Beispiel #1
0
 public PortfolioProvider(
     IStocksRepository stocksRepository,
     IMapper mapper,
     IStockPriceProvider stockPriceProvider)
 {
     _stocksRepository   = stocksRepository;
     _mapper             = mapper;
     _stockPriceProvider = stockPriceProvider;
 }
 public PendingStockActions(IStockPriceProvider priceProvider, IAccountLocator accountLocator, IAccountPersister accountPersister)
 {
     this.priceProvider = priceProvider;
     this.accountLocator = accountLocator;
     this.accountPersister = accountPersister;
     this.hubContext = GlobalHost.ConnectionManager.GetHubContext<StockTraderHub>();
     this.pendingActions = new List<PendingAction>();
     this.pendingActionsTimer = new Timer(this.PendingActionsCallback, null, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(3));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="GatherPriceData"/> class.
        /// </summary>
        /// <param name="stockPriceProvider">The stock price provider.</param>
        public GatherPriceData(IStockPriceProvider stockPriceProvider,
                               IStockDataProvider stockDataProvider)
        {
            Condition.Requires(stockPriceProvider).IsNotNull();
            Condition.Requires(stockDataProvider).IsNotNull();

            this._priceProvider     = stockPriceProvider;
            this._stockDataProvider = stockDataProvider;

            // TODO - inject this
            this._scheduler = new Scheduler.Scheduler();

            // Schedule the scrape every minute
            this._scheduler.AddScheduledAction(() => GetStockPrices(), new TimeSpan(0, 1, 0));
        }
Beispiel #4
0
 public RedditOtherProvider(IStocksRepository stocksRepository, IMapper mapper, IStockPriceProvider stockPriceProvider)
 {
     _stocksRepository   = stocksRepository;
     _mapper             = mapper;
     _stockPriceProvider = stockPriceProvider;
 }
Beispiel #5
0
 public PriceController(IStockPriceService stockPriceService, IStockPriceProvider stockPriceProvider)
 {
     _stockPriceService  = stockPriceService;
     _stockPriceProvider = stockPriceProvider;
 }
Beispiel #6
0
 public ShortInterestProvider(IShortInterestService shortInterestService, IStockPriceProvider stockPriceProvider)
 {
     _shortInterestService = shortInterestService;
     _stockPriceProvider   = stockPriceProvider;
 }