diff --git a/goxtool.py b/goxtool.py index b12b30c..e80325f 100755 --- a/goxtool.py +++ b/goxtool.py @@ -44,7 +44,7 @@ HEIGHT_STATUS = 2 HEIGHT_CON = 7 -WIDTH_ORDERBOOK = 45 +WIDTH_ORDERBOOK = 61 COLORS = [["con_text", curses.COLOR_BLUE, curses.COLOR_CYAN] ,["status_text", curses.COLOR_BLUE, curses.COLOR_CYAN] @@ -54,6 +54,7 @@ ,["book_ask", curses.COLOR_BLACK, curses.COLOR_RED] ,["book_own", curses.COLOR_BLACK, curses.COLOR_YELLOW] ,["book_vol", curses.COLOR_BLACK, curses.COLOR_BLUE] + ,["book_totalvol", curses.COLOR_BLACK, curses.COLOR_WHITE] ,["chart_text", curses.COLOR_BLACK, curses.COLOR_WHITE] ,["chart_up", curses.COLOR_BLACK, curses.COLOR_GREEN] @@ -255,19 +256,23 @@ def paint(self): col_ask = COLOR_PAIR["book_ask"] col_vol = COLOR_PAIR["book_vol"] col_own = COLOR_PAIR["book_own"] - + col_totalvol = COLOR_PAIR["book_totalvol"] + # print the asks # pylint: disable=C0301 book = self.gox.orderbook pos = mid - 1 i = 0 cnt = len(book.asks) + totalvol = 0 while pos >= 0 and i < cnt: self.addstr(pos, 0, goxapi.int2str(book.asks[i].price, book.gox.currency), col_ask) self.addstr(pos, 12, goxapi.int2str(book.asks[i].volume, "BTC"), col_vol) + totalvol += book.asks[i].volume + self.addstr(pos, 28, goxapi.int2str(totalvol, "BTC"), col_totalvol) ownvol = book.get_own_volume_at(book.asks[i].price) if ownvol: - self.addstr(pos, 28, goxapi.int2str(ownvol, "BTC"), col_own) + self.addstr(pos, 44, goxapi.int2str(ownvol, "BTC"), col_own) pos -= 1 i += 1 @@ -275,12 +280,15 @@ def paint(self): pos = mid + 1 i = 0 cnt = len(book.bids) + totalvol = 0 while pos < self.height and i < cnt: self.addstr(pos, 0, goxapi.int2str(book.bids[i].price, book.gox.currency), col_bid) self.addstr(pos, 12, goxapi.int2str(book.bids[i].volume, "BTC"), col_vol) + totalvol += book.bids[i].volume + self.addstr(pos, 28, goxapi.int2str(totalvol, "BTC"), col_totalvol) ownvol = book.get_own_volume_at(book.bids[i].price) if ownvol: - self.addstr(pos, 28, goxapi.int2str(ownvol, "BTC"), col_own) + self.addstr(pos, 44, goxapi.int2str(ownvol, "BTC"), col_own) pos += 1 i += 1