Change ui stuff to use new `Position.cumsize` attr name

account_tests
Tyler Goodlet 2023-07-26 12:40:09 -04:00
parent 58cf7ce10e
commit 4436342d33
4 changed files with 14 additions and 8 deletions

View File

@ -282,7 +282,7 @@ class GodWidget(QWidget):
# TODO: probably stick this in some kinda `LooknFeel` API? # TODO: probably stick this in some kinda `LooknFeel` API?
for tracker in self.rt_linked.mode.trackers.values(): for tracker in self.rt_linked.mode.trackers.values():
pp_nav = tracker.nav pp_nav = tracker.nav
if tracker.live_pp.size: if tracker.live_pp.cumsize:
pp_nav.show() pp_nav.show()
pp_nav.hide_info() pp_nav.hide_info()
else: else:

View File

@ -261,7 +261,7 @@ async def handle_viewmode_kb_inputs(
# show the pp size label only if there is # show the pp size label only if there is
# a non-zero pos existing # a non-zero pos existing
tracker = order_mode.current_pp tracker = order_mode.current_pp
if tracker.live_pp.size: if tracker.live_pp.cumsize:
tracker.nav.show() tracker.nav.show()
# TODO: show pp config mini-params in status bar widget # TODO: show pp config mini-params in status bar widget

View File

@ -227,7 +227,13 @@ class BarItems(FlowGraphic):
# last_row = ohlc[-1:] # last_row = ohlc[-1:]
# individual values # individual values
last_row = o, h, l, last, i = ohlc[-1] last_row = (
o,
h,
lo,
last,
i,
) = ohlc[-1]
# times = src_data['time'] # times = src_data['time']
# if times[-1] - times[-2]: # if times[-1] - times[-2]:
@ -254,17 +260,17 @@ class BarItems(FlowGraphic):
# writer is responsible for changing open on "first" volume of bar # writer is responsible for changing open on "first" volume of bar
larm.setLine(larm.x1(), o, larm.x2(), o) larm.setLine(larm.x1(), o, larm.x2(), o)
if l != h: # noqa if lo != h: # noqa
if body is None: if body is None:
body = self._last_bar_lines[0] = QLineF( body = self._last_bar_lines[0] = QLineF(
i + bg, l, i + bg, lo,
i + step_size - bg, h, i + step_size - bg, h,
) )
else: else:
# update body # update body
body.setLine( body.setLine(
body.x1(), l, body.x1(), lo,
body.x2(), h, body.x2(), h,
) )

View File

@ -279,7 +279,7 @@ class SettingsPane:
elif key != 'account': # numeric fields entry elif key != 'account': # numeric fields entry
try: try:
value = puterize(value) value: float = puterize(value)
except ValueError as err: except ValueError as err:
log.error(err.args[0]) log.error(err.args[0])
return False return False
@ -292,7 +292,7 @@ class SettingsPane:
lpos = mode.current_pp.live_pp lpos = mode.current_pp.live_pp
if alloc.size_unit == 'currency': if alloc.size_unit == 'currency':
dsize = lpos.dsize dsize: float = lpos.dsize
if dsize > value: if dsize > value:
log.error( log.error(
f'limit must > then current pp: {dsize}' f'limit must > then current pp: {dsize}'