Only do tracker update if pp msg is received for sym

fsp_feeds
Tyler Goodlet 2021-09-06 12:42:25 -04:00
parent 3713831070
commit b9ee0997a7
1 changed files with 19 additions and 18 deletions

View File

@ -574,31 +574,32 @@ async def open_order_mode(
# so that view handlers can access it # so that view handlers can access it
view.order_mode = mode view.order_mode = mode
our_sym = mode.chart.linked._symbol.key
# update any exising position
pp_msg = None
for sym, msg in positions.items():
if sym.lower() in our_sym:
pp_msg = msg
break
# make fill bar and positioning snapshot # make fill bar and positioning snapshot
# XXX: this need to be called *before* the first # XXX: this need to be called *before* the first
# pp tracker update(s) below to ensure the limit size unit has # pp tracker update(s) below to ensure the limit size unit has
# been correctly set prior to updating the line's pp size label # been correctly set prior to updating the line's pp size label
# (the one on the RHS) # (the one on the RHS).
# TODO: should probably split out the alloc config from the UI
# config startup steps..
order_pane.init_status_ui() order_pane.init_status_ui()
# update any exising position # we should probably make the allocator config
for sym, msg in positions.items(): # and explitict helper func call that takes in the aloc and
# the postion / symbol info then take that alloc ref and
# update the pp_tracker and pp_pane?
if pp_msg:
pp_tracker.update_from_pp_msg(msg)
our_sym = mode.chart.linked._symbol.key order_pane.update_status_ui()
if sym.lower() in our_sym:
# call this again now since we've configured
# the allocator from the asset type...super dumb.
# we should probably make the allocator config
# and explitict helper func call that takes in the aloc and
# the postion / symbol info then take that alloc ref and
# update the pp_tracker and pp_pane.
# pp_tracker.update(msg, position=pp_tracker.startup_pp)
pp_tracker.update_from_pp_msg(msg, position=pp_tracker.startup_pp)
pp_tracker.update_from_pp_msg(msg)
break
live_pp = mode.pp.live_pp live_pp = mode.pp.live_pp
size = live_pp.size size = live_pp.size