Exemplo n.º 1
0
 protected Trader(IStockDataReader stockDataReader, ITradingClient tradingClient,
                  IServiceProvider serviceProvider,
                  ApplicationUser user, Strategy strategy, ILogger log, SignalRService signalRService)
 {
     _stockDataReader = stockDataReader;
     _tradingClient   = tradingClient;
     _serviceProvider = serviceProvider;
     _user            = user;
     Strategy         = strategy;
     _log             = log;
     _signalRService  = signalRService;
 }
Exemplo n.º 2
0
        public Trader(IStockDataReader stockDataReader, ITradingClient tradingClient, string stock)
        {
            _stockDataReader = stockDataReader;
            _tradingClient   = tradingClient;
            _stock           = stock;

            try
            {
                _profit = Convert.ToDecimal(System.IO.File.ReadAllText("{AppConstants.FilePath}profit.txt"));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            _log = new LoggerConfiguration()
                   .WriteTo.Console()
                   .WriteTo.File($"{AppConstants.FilePath}log.txt")
                   .CreateLogger();
        }
Exemplo n.º 3
0
 public PercentTrader(IStockDataReader stockDataReader, ITradingClient tradingClient,
                      IServiceProvider serviceProvider, ApplicationUser user, Strategy strategy, ILogger log, SignalRService signalRService)
     : base(stockDataReader, tradingClient, serviceProvider, user, strategy, log, signalRService)
 {
 }