Пример #1
0
        static async Task <bool> Run()
        {
            // init
            RegisterHotKeys();
            var config = GetConfig();

            if (config is null)
            {
                throw new ConfigException("Unable to read config.js");
            }
            Logger.Info("config.js is valid.");
            var feedEngine = new DataFeedEngine(config.Pairs, config.Timeframe, config.LeaderboardWatch);

            feedEngine.ApplyAppConfig(config);
            Logger.Info($"Pairs added to data feed: {string.Join(", ", config.Pairs)}");
            await feedEngine.Start().ConfigureAwait(false);

            Logger.Info("Start successfully.");
            // start overlay
            using (var overlay = new OverlayEngine())
            {
                overlay.ApplyAppConfig(config);
                overlay.CustomMessages.Add($"RSI: {config.RsiPeriod} - Timeframe: {config.Timeframe}");
                overlay.Run();
            }
            return(true);
        }
Пример #2
0
 public static void ApplyAppConfig(this DataFeedEngine engine, AppConfig config)
 {
     engine.RsiPeriod        = config.RsiPeriod;
     engine.OverBought       = config.OverBoughtRsi;
     engine.OverSold         = config.OverSoldRsi;
     engine.AlertRsiExtremes = config.AlertRsiExtremes;
     //engine.CalculateWeightUsed = config.ShowUsedWeight;
 }