Woops, drop paper mode detection on client side..
parent
e7437cb722
commit
a4b8fb2d6b
|
@ -37,7 +37,6 @@ from ._messages import (
|
||||||
Cancel,
|
Cancel,
|
||||||
BrokerdPosition,
|
BrokerdPosition,
|
||||||
)
|
)
|
||||||
from ..brokers import get_brokermod
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ._messages import (
|
from ._messages import (
|
||||||
|
@ -246,13 +245,6 @@ async def open_ems(
|
||||||
loglevel=loglevel,
|
loglevel=loglevel,
|
||||||
) as portal:
|
) as portal:
|
||||||
|
|
||||||
mod = get_brokermod(broker)
|
|
||||||
if (
|
|
||||||
not getattr(mod, 'trades_dialogue', None)
|
|
||||||
or mode == 'paper'
|
|
||||||
):
|
|
||||||
mode = 'paper'
|
|
||||||
|
|
||||||
from ._ems import _emsd_main
|
from ._ems import _emsd_main
|
||||||
async with (
|
async with (
|
||||||
# connect to emsd
|
# connect to emsd
|
||||||
|
|
|
@ -353,7 +353,6 @@ async def open_brokerd_dialog(
|
||||||
# a paper-simulator clearing engine.
|
# a paper-simulator clearing engine.
|
||||||
|
|
||||||
# load the paper trading engine
|
# load the paper trading engine
|
||||||
exec_mode = 'paper'
|
|
||||||
log.info(f'{broker}: Entering `paper` trading mode')
|
log.info(f'{broker}: Entering `paper` trading mode')
|
||||||
|
|
||||||
# load the paper trading engine as a subactor of this emsd
|
# load the paper trading engine as a subactor of this emsd
|
||||||
|
@ -370,11 +369,12 @@ async def open_brokerd_dialog(
|
||||||
loglevel=loglevel,
|
loglevel=loglevel,
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO: ideally choose only one of these ep names..
|
# take the first supported ep we detect
|
||||||
|
# on the backend mod.
|
||||||
trades_endpoint: Callable
|
trades_endpoint: Callable
|
||||||
for ep_name in [
|
for ep_name in [
|
||||||
'trades_dialogue', # legacy
|
|
||||||
'open_trade_dialog', # probably final name?
|
'open_trade_dialog', # probably final name?
|
||||||
|
'trades_dialogue', # legacy
|
||||||
]:
|
]:
|
||||||
trades_endpoint = getattr(
|
trades_endpoint = getattr(
|
||||||
brokermod,
|
brokermod,
|
||||||
|
|
Loading…
Reference in New Issue