Пример #1
0
        static public Dictionary <string, TransforfField> GetOrderBook()
        {
            LiveCoinInfo LiveInfo = new LiveCoinInfo();

            string         order = "https://api.livecoin.net/exchange/all/order_book";
            HttpWebRequest req   = (HttpWebRequest)HttpWebRequest.Create(order);
            WebResponse    resp;

            try
            {
                resp = req.GetResponse();
            }
            catch (System.Net.WebException)
            {
                return(null);
            }
            Dictionary <string, TransforfField> temp;

            using (StreamReader stream = new StreamReader(
                       resp.GetResponseStream(), Encoding.UTF8))
            {
                string str = stream.ReadToEnd();
                var    res = JsonConvert.DeserializeObject <Dictionary <string, LiveAndPoloniexField> >(str);
                var    t   = res.Where(y => Cheaker(y) && LiveInfo.StatusCheaker(y.Key.Split('/')[0]));
                temp = t.ToDictionary(x => x.Key, y => new TransforfField(y.Value.asks, y.Value.bids));
            }
            return(temp);
        }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            LiveCoinInfo      LiveInfo  = new LiveCoinInfo();
            PoloniexCoinsInfo PolInfo   = new PoloniexCoinsInfo();
            CryptoCoinInfo    CryptInfo = new CryptoCoinInfo();
            BittrexCoinInfo   BitInfo   = new BittrexCoinInfo();
            YobitCoinIdenteti YouInfo   = new YobitCoinIdenteti();

            Console.WriteLine("get info");
            CheakCoinsInfo(ref CryptInfo.Data, LiveInfo.Data, PolInfo.Data, BitInfo.Data, YouInfo.Data);
            CheakCoinsInfo(ref BitInfo.Data, LiveInfo.Data, PolInfo.Data, CryptInfo.Data, YouInfo.Data);
            CheakCoinsInfo(ref YouInfo.Data, LiveInfo.Data, PolInfo.Data, CryptInfo.Data, BitInfo.Data);


            LiveCoinCoins live     = new LiveCoinCoins();
            PoloniexCoins poloniex = new PoloniexCoins();
            CryptoCoins   crypto   = new CryptoCoins(CryptInfo.Data);
            BittrexCoin   bittrex  = new BittrexCoin(BitInfo.Data);
            YobitCoins    Youibit  = new YobitCoins(YouInfo);

            //Дописать сравнение по имеющеййся на бирже валюте и констрктор
            List <MainStrategy> t   = CoinCompare(live.Data, poloniex.Data, "live", "poloniex");
            List <MainStrategy> t2  = CoinCompare(live.Data, crypto.Data, "live", "crypto");
            List <MainStrategy> t3  = CoinCompare(live.Data, bittrex.Data, "live", "bittrex");
            List <MainStrategy> t4  = CoinCompare(bittrex.Data, poloniex.Data, "bittrex", "poloniex");
            List <MainStrategy> t5  = CoinCompare(crypto.Data, poloniex.Data, "crypto", "poloniex");
            List <MainStrategy> t6  = CoinCompare(crypto.Data, bittrex.Data, "crypto", "bittrex");
            List <MainStrategy> t7  = CoinCompare(Youibit.Data, live.Data, "Youibit", "live");
            List <MainStrategy> t8  = CoinCompare(Youibit.Data, poloniex.Data, "Youibit", "poloniex");
            List <MainStrategy> t9  = CoinCompare(Youibit.Data, crypto.Data, "live", "crypto");
            List <MainStrategy> t10 = CoinCompare(Youibit.Data, bittrex.Data, "live", "bittrex");

            AddToColums(t);
            AddToColums(t2);
            AddToColums(t3);
            AddToColums(t4);
            AddToColums(t5);
            AddToColums(t6);
            AddToColums(t7);
            AddToColums(t8);
            AddToColums(t9);
            AddToColums(t10);
        }