static void Main(string[] args) { string requete = String.Empty; string monnaie = "ERC"; requete = "https://bittrex.com/api/v1.1/public/getmarkethistory?market=BTC-" + monnaie; WebClient client = new WebClient(); Market.Result marcheActuel = GetMarket(monnaie, client); GetVolumeEchange(monnaie, client); GetOrders(monnaie, client, marcheActuel); int i = 0; i++; i++; }
public static void GetOrders(string monnaie, WebClient client, Market.Result marche) { string requete = "https://bittrex.com/api/v1.1/public/getorderbook?market=BTC-" + monnaie + "&type=both"; string resultat = LectureWeb.LireContenuWeb(client, requete); Ordre ordres = JsonConvert.DeserializeObject <Ordre>(resultat); double masseAchat = 0; double masseVente = 0; foreach (Ordre.Buy achat in ordres.result.buy) { masseAchat += achat.Quantity; } foreach (Ordre.Sell vente in ordres.result.sell) { masseVente += vente.Quantity; } Console.WriteLine("Market : BTC-{0}", monnaie); Console.WriteLine("Volume a l'achat : {0}", masseAchat); Console.WriteLine("Volume a la vente : {0}", masseVente); }