File tree 4 files changed +25
-10
lines changed
4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -661,10 +661,14 @@ async def submit_limit(
661
661
signed = True ,
662
662
action = 'post'
663
663
)
664
- reqid : str = resp ['orderId' ]
664
+ # import tractor
665
+ # await tractor.breakpoint()
666
+
667
+ # ensure our id is tracked by them
665
668
if oid :
666
- assert oid == reqid
669
+ assert oid == resp [ 'clientOrderId' ]
667
670
671
+ reqid : str = resp ['orderId' ]
668
672
return reqid
669
673
670
674
async def submit_cancel (
Original file line number Diff line number Diff line change 21
21
'''
22
22
from __future__ import annotations
23
23
from functools import partial
24
- from typing import Literal
24
+ from typing import (
25
+ Literal ,
26
+ TYPE_CHECKING ,
27
+ )
25
28
import subprocess
26
29
27
30
import tractor
28
31
29
32
from .._util import get_logger
30
33
34
+ if TYPE_CHECKING :
35
+ from .api import Client
36
+ from ib_insync import IB
37
+
31
38
log = get_logger ('piker.brokers.ib' )
32
39
33
40
_reset_tech : Literal [
42
49
43
50
44
51
async def data_reset_hack (
45
- vnc_host : str ,
52
+ # vnc_host: str,
53
+ client : Client ,
46
54
reset_type : Literal ['data' , 'connection' ],
47
55
48
56
) -> None :
Original file line number Diff line number Diff line change @@ -512,9 +512,9 @@ async def open_trade_event_stream(
512
512
async with tractor .to_asyncio .open_channel_from (
513
513
recv_trade_updates ,
514
514
client = client ,
515
- ) as (ibclient , trade_event_stream ):
515
+ ) as (_ , trade_event_stream ):
516
516
517
- assert ibclient is client .ib
517
+ # assert ibclient is client.ib
518
518
task_status .started (trade_event_stream )
519
519
await trio .sleep_forever ()
520
520
Original file line number Diff line number Diff line change 37
37
38
38
from async_generator import aclosing
39
39
from fuzzywuzzy import process as fuzzy
40
+ import ib_insync as ibis
40
41
import numpy as np
41
42
import pendulum
42
43
import tractor
50
51
)
51
52
from .api import (
52
53
# _adhoc_futes_set,
54
+ Client ,
53
55
con2fqme ,
54
56
log ,
55
57
load_aio_clients ,
56
- ibis ,
57
58
MethodProxy ,
58
59
open_client_proxies ,
59
60
get_preferred_data_client ,
@@ -276,7 +277,8 @@ async def wait_on_data_reset(
276
277
# )
277
278
# try to wait on the reset event(s) to arrive, a timeout
278
279
# will trigger a retry up to 6 times (for now).
279
- client = proxy ._aio_ns .ib .client
280
+ client : Client = proxy ._aio_ns
281
+ ib_client : ibis .IB = client .ib
280
282
281
283
done = trio .Event ()
282
284
with trio .move_on_after (timeout ) as cs :
@@ -285,10 +287,11 @@ async def wait_on_data_reset(
285
287
286
288
log .warning (
287
289
'Sending DATA RESET request:\n '
288
- f'{ client } '
290
+ f'{ ib_client . client } '
289
291
)
290
292
res = await data_reset_hack (
291
- vnc_host = client .host ,
293
+ # vnc_host=client.host,
294
+ ib_client = ib_client ,
292
295
reset_type = reset_type ,
293
296
)
294
297
You can’t perform that action at this time.
0 commit comments