示例#1
0
        private TradeFlowAnalyzer AnalyzeTradeFlow()
        {
            var bittrexTradingFee         = Decimal.Parse(_configuration["BittrexAccount:TradingFee"]);
            var bittrexBitcoinTransferFee = Decimal.Parse(_configuration["BittrexAccount:BitcoinTransferFee"]);
            var bittrexAccount            = new BittrexAccount(
                this._options.Coin,
                bittrexTradingFee,
                bittrexBitcoinTransferFee,
                _configuration["BittrexAccount:API_KEY"],
                _configuration["BittrexAccount:API_SECRET"],
                _serviceProvider.GetRequiredService <ILogger <BittrexAccount> >());

            var binanceTradingFee         = Decimal.Parse(_configuration["BinanceAccount:TradingFee"]);
            var binanceBitcoinTransferFee = Decimal.Parse(_configuration["BinanceAccount:BitcoinTransferFee"]);
            var binanceAccount            = new BinanceAccount(
                this._options.Coin,
                binanceTradingFee,
                binanceBitcoinTransferFee,
                _configuration["BinanceAccount:API_KEY"],
                _configuration["BinanceAccount:API_SECRET"],
                _serviceProvider.GetRequiredService <ILogger <BinanceAccount> >());

            var tradeAccounts = new List <ITradeAccount>()
                                .AddTradeAccount(binanceAccount)
                                .AddTradeAccount(bittrexAccount);

            var tradeFlowAnalyzer = new TradeFlowAnalyzer(this._options.TradeFlow, tradeAccounts);

            return(tradeFlowAnalyzer);
        }
示例#2
0
        private TradeFlowAnalyzer AnalyzeTradeFlow()
        {
            var bittrexTradingFee         = Decimal.Parse(_configuration["BittrexAccount:TradingFee"]);
            var bittrexBitcoinTransferFee = Decimal.Parse(_configuration["BittrexAccount:BitcoinTransferFee"]);
            var bittrexAccount            = new BittrexAccount(
                this._options.Coin,
                bittrexTradingFee,
                bittrexBitcoinTransferFee);

            var binanceTradingFee         = Decimal.Parse(_configuration["BinanceAccount:TradingFee"]);
            var binanceBitcoinTransferFee = Decimal.Parse(_configuration["BinanceAccount:BitcoinTransferFee"]);
            var binanceAccount            = new BinanceAccount(
                this._options.Coin,
                binanceTradingFee,
                binanceBitcoinTransferFee);

            var tradeFlowAnalyzer = new TradeFlowAnalyzer(
                this._options.TradeFlow, binanceAccount, bittrexAccount
                );

            return(tradeFlowAnalyzer);
        }