public BackTestWorker(IBaseData baseData, string stockId, Action <string> writeToLogAction, Action <Exception> writeToErrorLogAction, bool alwaysRun = true) : base(baseData) { _baseData = baseData; _stockId = stockId; _startDate = baseData.CurrentTime; _endDate = DateTime.Now; _writeToLogAction = writeToLogAction; _writeToErrorLogAction = writeToErrorLogAction; // create StorageSpace _storage = new CurrentPriceStorage(); // create Turtle Database _turtleDbOperations = new TurtleDatabaseOperations(baseData.SystemConfig.SystemInfo.ProductionTurtleDBConnectionString); _memoryDbOperations = new MemoryDatabaseOperations(); _prepareMemoryDbTask = Task.Run(() => PrepareMemoryDatabaseAsync()); // _stockPriceNotificationChecker = BaseData.CreateStockPriceNotificationChecker(); // create EmailService and EmailTemplateProvider _logger = BaseData.GetLogger(); _notificationService = new BackTestNotificationService(_logger); _notificationTemplateProvider = new BackTestNotificationTemplateProvider(); }
public BaseData(CountryKind country, IDateTimeTool2 variableDateTimeTool, ITurtleLogger logger, ISystemConfig systemConfig) { Country = country; _dateTimeTool = variableDateTimeTool; _logger = logger; SystemConfig = systemConfig; }
public BaseData(CountryKind country, ITurtleLogger logger, ISystemConfig systemConfig, bool runInTestMode = false) { Country = country; _dateTimeTool = DateTimeFactory.GenerateDateTimeTool(country); _logger = logger; SystemConfig = systemConfig; RunInTestMode = runInTestMode; }
public static IBaseData CreateBaseDataWithVariableDateTimeTool(CountryKind country, DateTime startDate, ITurtleLogger logger, ISystemConfig systemConfig) { VariableDateTimeTool dateTool = new VariableDateTimeTool(); dateTool.SetTime(startDate); return(new BaseData(country, dateTool, logger, systemConfig)); }
public static IBaseData CreateBaseData(CountryKind country, ITurtleLogger logger, ISystemConfig systemConfig, bool runInTestMode = false) { return(new BaseData(country, logger, systemConfig, runInTestMode)); }
public BackTestNotificationService(ITurtleLogger logger) { _records = new List <BackTestBuySellRecord>(); _logger = logger; }
public TurtleEmailService(ITurtleLogger logger, ISMTPInfo smtpInfo) { _logger = logger; _smtpInfo = smtpInfo; }