private void UpdateConfigWithArgs(ParseResult parseResult, ICoreConfig config) { if (parseResult["backtesting"] != null) { config.Backtesting.Enabled = true; config.Backtesting.PostAnalysisEnabled = (bool)parseResult["backtesting_analysis"]; config.Notification.Enabled = false; config.Trader.Enabled = false; config.TraderSimulator.Enabled = true; } if (parseResult["simulate"] != null) { config.Trader.Enabled = false; config.TraderSimulator.Enabled = true; } if (parseResult["risk"] != null) { decimal risk = (decimal)parseResult["risk"]; if (0 < risk && risk <= 1) { config.Trading.Risk = risk; } } }
public CastleService(ICoreConfig config, ILogger logger, ISqlService sqlService, IConfiguration settings) { this.config = config; this.logger = logger; this.sqlService = sqlService; this.settings = settings; }
public static void TryAddCoreServices(this IServiceCollection services, ICoreConfig config) { services.TryAddSingleton <ICoreConfig>(config); services.TryAddScoped <IScriptService, ScriptService>(); services.TryAddScoped <IThemeService>(sp => new ThemeService(config.Theme)); services.TryAddScoped <IRenderContext>(sp => new RenderContext(config.IsServer, config.IsPreRendering)); }
public OctoBot(ICoreConfig config, bool ignoreConfig = false, bool resetTradingHistory = false) { StartTime = DateTimeOffset.Now; Config = config; ResetTradingHistory = resetTradingHistory; StartupConfig = config.DeepClone(); EditedConfig = config.DeepClone(); // tools: используется для альтернативных операций в ботом на лету (например, «backtesting» запускается из веб-интерфейса) Tools = new Dictionary <string, object>() { { ConfigVars.BOT_TOOLS_BACKTESTING, null }, { ConfigVars.BOT_TOOLS_STRATEGY_OPTIMIZER, null }, { ConfigVars.BOT_TOOLS_RECORDER, null } }; // уникальное значение сеанса aiohttp: инициализируется из геттера в задаче AioHttpSession = null; // metrics если включены MetricsHandler = null; // Logger loggingService = Application.Resolve <ILoggingService>(); Initializer = new Initializer(this); TaskManager = new TaskManager(this); ExchangeFactory = new ExchangeFactory(this, ignoreConfig); EvaluatorFactory = new EvaluatorFactory(this); }
public static void InitAdvancedClassesIfNecessary(ICoreConfig config) { if (config.AdvancedClasses.Count > 0) { Debug.WriteLine(1); } }
public static void TryAddPrismServices(this IServiceCollection services, ICoreConfig config) { services.TryAddCoreServices(config); services.TryAddScoped <IPrismHighlighter, PrismHighlighter>(); services.TryAddScriptTypeProvider <PrismScriptProvider>(); services.TryAddStyleTypeProvider <PrismStyleProvider>(); }
public void InjectDependencies( ICoreConfig coreConfig, IYieldFormatter yieldFormatter, DiContainer container ) { CoreConfig = coreConfig; YieldFormatter = yieldFormatter; Container = container; }
public static void ReloadTentacleConfig(ICoreConfig config) { var a = ConfigBase.LoadConfig(ConfigVars.CONFIG_EVALUATOR_FILE_PATH, false); //config.Evaluator = ConfigBase.LoadConfig(ConfigVars.CONFIG_EVALUATOR_FILE_PATH, false); //if (config.Evaluator == null) throw new ConfigEvaluatorError(); Debug.WriteLine(1); }
public bool IsEnabled(Type cls, ICoreConfig config, bool defaultObject) { if (config.Evaluator.Count > 0) { } Debug.WriteLine(1); return(false); }
public TentaclePackageManager(ICoreConfig config, TentacleManager tentacleManager) { Config = config; TentacleManager = tentacleManager; JustProcessedModules = new List <string>(); InstalledModules = new Dictionary <string, object>(); MaxSteps = null; CurrentStep = 1; loggingService = Application.Resolve <ILoggingService>(); }
public TentacleManager(ICoreConfig config) { Config = config; TentaclePackageManager = new TentaclePackageManager(config, this); DefaultPackage = null; AdvancedPackageList = new List <object>(); ForceActions = false; GitBranch = TentaclesManagerVars.TENTACLES_DEFAULT_BRANCH; loggingService = Application.Resolve <ILoggingService>(); }
public static void TryAddDevToolsServices(this IServiceCollection services, ICoreConfig config) { services.TryAddCoreServices(config); services.TryAddJsonServices(); services.TryAddScoped(typeof(IReduxTool <,>), typeof(ReduxTool <,>)); services.TryAddScoped(typeof(IStateTreeTool <>), typeof(StateTreeTool <>)); services.TryAddScriptTypeProvider <DevToolsScriptProvider>(); }
public B With(ICoreConfig config) { WithIsServer(config.IsServer); WithIsPreRendering(config.IsPreRendering); WithDisableBinding(config.DisableBinding); WithDisableConfigurer(config.DisableConfigurer); WithTheme(config.Theme); return(Builder()); }
private void LogTermsIfUnaccepted(ICoreConfig config) { if (ConfigManager.AcceptedTerms(Config) == false) { loggingService.Info("*** Disclaimer ***"); foreach (var line in DISCLAIMER) { loggingService.Info(line); } loggingService.Info("... Disclaimer ..."); } else { loggingService.Info("Отказ от ответственности принят пользователем."); } }
public static bool InstallOnDevelopment(ICoreConfig config, bool?moduleDev) { // is not on development if (moduleDev == null || moduleDev == false) { return(true); } // is on development if (moduleDev == true && config.DevMode != null && config.DevMode == true) { return(true); } return(false); }
private static List <Type> GetClasses(ICoreConfig config, Type classType, bool getAllClasses = false) { List <Type> classes = new List <Type>(); if (AdvancedManager.GetAdvancedClassesList(config).ContainsKey(classType.Name) == true) { //classes = copy(AdvancedManager._get_advanced_classes_list(config)[class_type.get_name()]) Debug.WriteLine(1); } if (classes.Count == 0 || (getAllClasses == true && classes.Contains(classType) == false)) { classes.Add(classType); } return(classes); }
private void AutoOpenWeb(ICoreConfig config, OctoBot bot) { try { // Ожидаем готовность бота к работе while (bot.IsReady() == false) { Thread.Sleep(100); } //webbrowser.open(String.Format("http://{0}:{1}", socket.gethostbyname(socket.gethostname()), config.Services[] [CONFIG_WEB][CONFIG_WEB_PORT]); } catch (Exception exc) { loggingService.Error(String.Format("{0}, невозможно автоматически открыть веб-интерфейс", exc.Message)); } }
public static void InitTimeFramesFromStrategies(ICoreConfig config) { object timeFrameList = null; var lst = AdvancedManager.CreateAdvancedEvaluatorTypesList(typeof(StrategiesEvaluator), config); foreach (Type strategiesEvalClass in lst) { var instance = (IAbstractEvaluator)Activator.CreateInstance(strategiesEvalClass); if (instance.IsEnabled(strategiesEvalClass, config, false) == true) { } Debug.WriteLine(1); } Debug.WriteLine(1); }
public static bool IsInDevMode(ICoreConfig config) { // return True если "DEV-MODE": true в config.json return((bool)config.DevMode); }
public static void TryAddMaterialCoreServices(this IServiceCollection services, ICoreConfig config) { services.TryAddDomHelpersServices(config); }
public void SetUp() { _coreConfig = ConfigurationFactory.Create(); }
public static List <Type> CreateAdvancedEvaluatorTypesList(Type evaluatorClass, ICoreConfig config) { List <Type> evaluatorAdvancedEvalClassList = new List <Type>(); IEnumerable <Type> lstEvaluatorClass = FindDerivedTypes(evaluatorClass); foreach (Type evaluatorSubclass in lstEvaluatorClass) { IEnumerable <Type> lstEvaluatorSubclass = FindDerivedTypes(evaluatorSubclass); foreach (Type evalClass in lstEvaluatorSubclass) { foreach (Type evalClassType in AdvancedManager.GetClasses(config, evalClass)) { evaluatorAdvancedEvalClassList.Add(evalClassType); } } } if (AdvancedManager.CheckDuplicate(evaluatorAdvancedEvalClassList) == false) { var logger = Application.Resolve <ILoggingService>(); logger.Warning("Дубликат имени evaluator"); } return(evaluatorAdvancedEvalClassList); }
private static Dictionary <string, object> GetAdvancedClassesList(ICoreConfig config) { return(config.AdvancedClasses); }
public YieldFormatter(ICoreConfig coreConfig) { CoreConfig = coreConfig; }
public static void TryAddFlightFinderViewServices(this IServiceCollection services, ICoreConfig config) { services.TryAddMobxServices(config); services.TryAddFlightFinderStateServices(); services.TryAddDevToolsServices(config); }
public static bool AcceptedTerms(ICoreConfig config) { return(config.AcceptedTerms); }
public ValuesController(IHttpContextAccessor httpContextAccessor, ICoreConfig config) { _httpContextAccessor = httpContextAccessor; _config = config; }
public void InjectDependencies(IYieldFormatter yieldFormatter, ICoreConfig coreConfig) { YieldFormatter = yieldFormatter; CoreConfig = coreConfig; }
public ITentacleManager CreateTentacleManager(ICoreConfig coreConfig) { return(new TentacleManager(coreConfig)); }
public static void TryAddDomHelpersServices(this IServiceCollection services, ICoreConfig config) { services.TryAddCoreServices(config); services.TryAddScoped <DomHelpers>(); services.TryAddTransient <EventDelegator>(); services.TryAddTransient <MediaQueryMatcher>(); services.TryAddTransient <DetectThemeHelper>(); services.TryAddTransient <HistoryBackHelper>(); services.TryAddScriptTypeProvider <DomHelpersScriptProvider>(); }
public static void PackageManager(ITentacleManagerService tentacleManagerService, ICoreConfig config, IList <string> commands, bool useCatch = false, bool force = false, string defaultGitBranch = "") { if (defaultGitBranch == "") { defaultGitBranch = TentaclesManagerVars.TENTACLES_DEFAULT_BRANCH; } try { if (commands.Contains(ConfigVars.TENTACLES_FORCE_CONFIRM_PARAM) == true) { force = true; commands.Remove(ConfigVars.TENTACLES_FORCE_CONFIRM_PARAM); } var tentacleManager = tentacleManagerService.CreateTentacleManager(config); tentacleManager.ParseCommands(commands, force, defaultGitBranch); } catch (Exception exc) { if (useCatch == false) { throw new Exception(exc.Message); } } }
public JiraConfig(ICoreConfig coreConfig) { _coreConfig = coreConfig; }