Example #1
0
        static void Main(string[] args)
        {
            var api = new CryptocoreApi();
            //
            var symbols = api.GetSymbolsAsync("BINANCE").Result;

            Console.WriteLine("Symbols:");
            foreach (var s in symbols)
            {
                Console.WriteLine($"--> {s}");
            }
            Console.WriteLine();
            //
            var symbol = symbols.First();
            var quote  = api.GetLatestQuoteAsync(symbol).Result;

            //
            Console.WriteLine($"Quote by {symbol}:");

            Console.WriteLine($"--> Timestamp: {quote.Timestamp}");
            Console.WriteLine($"--> Ask: {quote.Ask} ({quote.AskSize})");
            Console.WriteLine($"--> Bid: {quote.Bid} ({quote.BidSize})");
            Console.WriteLine($"--> Last: {quote.Last} ({quote.LastSize})");

            Console.WriteLine();
            //
            Console.WriteLine("Press enter...");
            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            var api = new CryptocoreApi();

            // get first symbol from Binance
            var symbol = api.GetSymbolsAsync("BINANCE").Result.First();

            Console.WriteLine($"Try to send order by: {symbol}");
            Console.WriteLine();

            // get quote
            var quote = api.GetLatestQuoteAsync(symbol).Result;

            // create user
            // pass api key
            var user = new CryptocoreApiUser("");

            // send order to exchange
            var order = api.PlaceAsync(user, symbol, OrderType.Limit, OrderSide.Buy, quote.Ask, 100).Result;

            Console.WriteLine($"Order Id: {order.Id}");
            Console.WriteLine();
            //
            Console.WriteLine("Press enter...");
            Console.ReadLine();
        }