private void AnalyzeTheTradeFlow( TradeFlow tradeFlow, List <ITradeAccount> tradeAccounts) { switch (tradeFlow) { case TradeFlow.BuyAtBinanceSellAtBittrex: this.SellAccount = tradeAccounts.FirstOrDefault(acc => acc is BittrexAccount); this.BuyAccount = tradeAccounts.FirstOrDefault(acc => acc is BinanceAccount);; break; case TradeFlow.SellAtBinanceBuyAtBittrex: this.SellAccount = tradeAccounts.FirstOrDefault(acc => acc is BinanceAccount); this.BuyAccount = tradeAccounts.FirstOrDefault(acc => acc is BittrexAccount);; break; case TradeFlow.AutoSwitch: // We will decide about this at TradeInfo Analyzer step this.SellAccount = null; this.BuyAccount = null; break; default: break; } }
public TradeFlowAnalyzer( TradeFlow tradeFlow, List <ITradeAccount> tradeAccounts) { this.TradeAccounts = tradeAccounts; AnalyzeTheTradeFlow( tradeFlow, tradeAccounts); }
public TradeFlowAnalyzer( TradeFlow tradeFlow, ITradeAccount binanceAccount, ITradeAccount bittrexAccount) { AnalyzeTheTradeFlow( tradeFlow, binanceAccount, bittrexAccount); }
private void AnalyzeTheTradeFlow( TradeFlow tradeFlow, ITradeAccount binanceAccount, ITradeAccount bittrexAccount) { switch (tradeFlow) { case TradeFlow.BuyAtBinanceSellAtBittrex: this.SellAccount = bittrexAccount; this.BuyAccount = binanceAccount; break; case TradeFlow.SellAtBinanceBuyAtBittrex: this.SellAccount = binanceAccount; this.BuyAccount = bittrexAccount; break; default: break; } }