Exemplo n.º 1
0
        public override bool InitIndicatorsAsync()
        {
            string  directoryName   = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
            string  env             = TestMode ? "test" : "live";
            string  coinbaseRSIFile = Path.Combine(directoryName, $"data\\coinbase_{env}");
            Product product         = Products.FirstOrDefault(x => x.BaseCurrency == "BTC" && x.QuoteCurrency == "EUR");
            RelativeStrengthIndex relativeStrengthIndex = new RelativeStrengthIndex(coinbaseRSIFile, product);

            if (product != null)
            {
                relativeStrengthIndex.TechnicalIndicatorInformationBroadcast +=
                    delegate(Dictionary <string, string> input)
                {
                    TechnicalIndicatorInformationBroadcast?.Invoke(ApplicationName, input);
                };
                relativeStrengthIndex.ProcessLogBroadcast += delegate(MessageType messageType, string message)
                {
                    ProcessLogBroadcast?.Invoke(ApplicationName, messageType, message);
                };
                relativeStrengthIndex.UpdateProductHistoricCandles += UpdateProductHistoricCandlesAsync;
                relativeStrengthIndex.EnableRelativeStrengthIndexUpdater();
                return(true);
            }

            return(false);
        }