Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
 public TradeFlowAnalyzer(
     TradeFlow tradeFlow,
     List <ITradeAccount> tradeAccounts)
 {
     this.TradeAccounts = tradeAccounts;
     AnalyzeTheTradeFlow(
         tradeFlow,
         tradeAccounts);
 }
Ejemplo n.º 3
0
 public TradeFlowAnalyzer(
     TradeFlow tradeFlow,
     ITradeAccount binanceAccount,
     ITradeAccount bittrexAccount)
 {
     AnalyzeTheTradeFlow(
         tradeFlow,
         binanceAccount,
         bittrexAccount);
 }
Ejemplo n.º 4
0
        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;
            }
        }