MCPcopy Index your code
hub / github.com/ccxt/ccxt / main

Method main

java/examples/src/main/java/examples/WatchTicker.java:16–42  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

14public 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}

Callers

nothing calls this directly

Calls 3

loadMarketsMethod · 0.95
watchTickerMethod · 0.95
repeatMethod · 0.80

Tested by

no test coverage detected