示例#1
0
        private static void DoAnalysis(List <IExchange> exchanges)
        {
            const int maxCurrencies = 14;
            Dictionary <IExchange, List <Market> > validMarkets
                = MarketAnalyser.GetHighVolumeMarkets(exchanges, "BTC", maxCurrencies);
            MarketMatrix marketMatrix = new MarketMatrix(validMarkets);

            marketMatrix.UpdateAllPrices();
            marketMatrix.AddIndirectExchanges("DOGE", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("GDC", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("MEC", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("NET", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("PPC", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("QRK", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("WDC", "LTC", "BTC");

            // Strip any opportunities less than 1%, as non-viable

            foreach (ArbitrageOpportunity opportunity in marketMatrix
                     .GetArbitrageOpportunities()
                     .Where(opportunity => opportunity.ProfitPercentage >= 1.0m))
            {
                Console.WriteLine(opportunity.ToString());
            }

            Console.WriteLine("\nDone; press any key to exit");
            Console.ReadKey();
        }
示例#2
0
        private static void DoAnalysis(List<IExchange> exchanges)
        {
            const int maxCurrencies = 14;
            Dictionary<IExchange, List<Market>> validMarkets
                = MarketAnalyser.GetHighVolumeMarkets(exchanges, "BTC", maxCurrencies);
            MarketMatrix marketMatrix = new MarketMatrix(validMarkets);

            marketMatrix.UpdateAllPrices();
            marketMatrix.AddIndirectExchanges("DOGE", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("GDC", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("MEC", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("NET", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("PPC", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("QRK", "LTC", "BTC");
            marketMatrix.AddIndirectExchanges("WDC", "LTC", "BTC");

            // Strip any opportunities less than 1%, as non-viable

            foreach (ArbitrageOpportunity opportunity in marketMatrix
                .GetArbitrageOpportunities()
                .Where(opportunity => opportunity.ProfitPercentage >= 1.0m))
            {
                Console.WriteLine(opportunity.ToString());
            }

            Console.WriteLine("\nDone; press any key to exit");
            Console.ReadKey();
        }