From 65a7853cf3c562ca72923c7e74d8babc3efe7f76 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 14 Mar 2023 20:56:35 -0400 Subject: [PATCH] Delegate to new `.accounting._mktinfo._derivs` from `ui._positioning` --- piker/ui/_position.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/piker/ui/_position.py b/piker/ui/_position.py index 3574dd2d..547977dc 100644 --- a/piker/ui/_position.py +++ b/piker/ui/_position.py @@ -46,7 +46,13 @@ from ..calc import ( puterize, ) from ..clearing._allocate import Allocator -from ..accounting import Position +from ..accounting import ( + Position, +) +from ..accounting._mktinfo import ( + _derivs, +) + from ..data._normalize import iterticks from ..data.feed import ( Feed, @@ -85,7 +91,7 @@ async def update_pnl_from_feed( pp: PositionTracker = order_mode.current_pp live: Position = pp.live_pp - key: str = live.symbol.front_fqsn() + key: str = live.symbol.fqme log.info(f'Starting pnl display for {pp.alloc.account}') @@ -424,7 +430,7 @@ class SettingsPane: # maybe start update task global _pnl_tasks - fqsn = sym.front_fqsn() + fqsn = sym.fqme if fqsn not in _pnl_tasks: _pnl_tasks[fqsn] = True self.order_mode.nursery.start_soon( @@ -495,14 +501,6 @@ def pp_line( return line -_derivs = ( - 'future', - 'continuous_future', - 'option', - 'futures_option', -) - - # TODO: move into annoate module? def mk_level_marker( chart: ChartPlotWidget,