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?
for tracker in self.rt_linked.mode.trackers.values():
pp_nav = tracker.nav
if tracker.live_pp.size:
if tracker.live_pp.cumsize:
pp_nav.show()
pp_nav.hide_info()
else:

View File

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

View File

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

View File

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