Add paper engine "offline loading" support to the ledger cli
parent
2f31e40d3b
commit
5c61055411
|
@ -93,6 +93,7 @@ def sync(
|
||||||
account: str,
|
account: str,
|
||||||
|
|
||||||
loglevel: str = 'cancel',
|
loglevel: str = 'cancel',
|
||||||
|
pdb: bool = False,
|
||||||
):
|
):
|
||||||
|
|
||||||
start_kwargs, _, trades_ep = broker_init(
|
start_kwargs, _, trades_ep = broker_init(
|
||||||
|
@ -106,6 +107,8 @@ def sync(
|
||||||
open_piker_runtime(
|
open_piker_runtime(
|
||||||
name='ledger_cli',
|
name='ledger_cli',
|
||||||
loglevel=loglevel,
|
loglevel=loglevel,
|
||||||
|
debug_mode=pdb,
|
||||||
|
|
||||||
) as (actor, sockaddr),
|
) as (actor, sockaddr),
|
||||||
|
|
||||||
tractor.open_nursery() as an,
|
tractor.open_nursery() as an,
|
||||||
|
@ -120,12 +123,12 @@ def sync(
|
||||||
brokername == 'paper'
|
brokername == 'paper'
|
||||||
or trades_ep is None
|
or trades_ep is None
|
||||||
):
|
):
|
||||||
# from . import _paper_engine as paper
|
from ..clearing import _paper_engine as paper
|
||||||
# open_trades_endpoint = paper.open_paperboi(
|
open_trades_endpoint = paper.open_paperboi(
|
||||||
# fqme='.'.join([symbol, broker]),
|
fqme=None, # tell paper to not start clearing loop
|
||||||
# loglevel=loglevel,
|
broker=brokername,
|
||||||
# )
|
loglevel=loglevel,
|
||||||
RuntimeError('Paper mode not supported for sync!')
|
)
|
||||||
else:
|
else:
|
||||||
# open live brokerd trades endpoint
|
# open live brokerd trades endpoint
|
||||||
open_trades_endpoint = portal.open_context(
|
open_trades_endpoint = portal.open_context(
|
||||||
|
|
Loading…
Reference in New Issue