(String[] args)
| 14 | public class WatchTicker { |
| 15 | |
| 16 | public static void main(String[] args) throws Exception { |
| 17 | String symbol = args.length > 0 ? args[0] : "BTC/USDT"; |
| 18 | |
| 19 | Binance exchange = new Binance(); |
| 20 | exchange.verbose = false; |
| 21 | |
| 22 | System.out.println("Loading markets..."); |
| 23 | exchange.loadMarkets(false); |
| 24 | System.out.println("Watching " + symbol + " ticker (20 updates)...\n"); |
| 25 | |
| 26 | System.out.printf("%-26s %12s %12s %12s %10s%n", |
| 27 | "Datetime", "Last", "Bid", "Ask", "Volume"); |
| 28 | System.out.println("-".repeat(74)); |
| 29 | |
| 30 | for (int i = 0; i < 20; i++) { |
| 31 | Ticker ticker = exchange.watchTicker(symbol); |
| 32 | System.out.printf("%-26s %12s %12s %12s %10s%n", |
| 33 | ticker.datetime, |
| 34 | ticker.last, |
| 35 | ticker.bid, |
| 36 | ticker.ask, |
| 37 | ticker.baseVolume); |
| 38 | } |
| 39 | |
| 40 | System.out.println("\nDone!"); |
| 41 | System.exit(0); |
| 42 | } |
| 43 | } |
nothing calls this directly
no test coverage detected