Qubx 0.2.70__cp311-cp311-manylinux_2_35_x86_64.whl → 0.2.71__cp311-cp311-manylinux_2_35_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Qubx might be problematic. Click here for more details.

@@ -468,11 +468,13 @@ class SimulatedExchange(IBrokerServiceProvider):
468
468
 
469
469
  if silent:
470
470
  for symbol, data_type, event in qiter:
471
- _run(symbol, data_type, event)
471
+ if not _run(symbol, data_type, event):
472
+ break
472
473
  else:
473
474
  with tqdm(total=total_duration.total_seconds(), desc="Simulating", unit="s", leave=False) as pbar:
474
475
  for symbol, data_type, event in qiter:
475
- _run(symbol, data_type, event)
476
+ if not _run(symbol, data_type, event):
477
+ break
476
478
  dt = pd.Timestamp(event.time)
477
479
  # update only if date has changed
478
480
  if dt - prev_dt > update_delta:
@@ -484,7 +486,7 @@ class SimulatedExchange(IBrokerServiceProvider):
484
486
 
485
487
  logger.info(f"SimulatedExchangeService :: run :: Simulation finished at {end}")
486
488
 
487
- def _run_generated_signals(self, symbol: str, data_type: str, data: Any) -> None:
489
+ def _run_generated_signals(self, symbol: str, data_type: str, data: Any) -> bool:
488
490
  is_hist = data_type.startswith("hist")
489
491
  if is_hist:
490
492
  raise ValueError("Historical data is not supported for pre-generated signals !")
@@ -503,7 +505,9 @@ class SimulatedExchange(IBrokerServiceProvider):
503
505
  cc.send((symbol, "event", {"order": sigs[0][1]}))
504
506
  sigs.pop(0)
505
507
 
506
- def _run_as_strategy(self, symbol: str, data_type: str, data: Any) -> None:
508
+ return cc.control.is_set()
509
+
510
+ def _run_as_strategy(self, symbol: str, data_type: str, data: Any) -> bool:
507
511
  cc = self.get_communication_channel()
508
512
  t = data.time # type: ignore
509
513
  self._current_time = max(np.datetime64(t, "ns"), self._current_time)
@@ -525,6 +529,8 @@ class SimulatedExchange(IBrokerServiceProvider):
525
529
  if q is not None and data_type != "quote":
526
530
  cc.send((symbol, "quote", q))
527
531
 
532
+ return cc.control.is_set()
533
+
528
534
  def get_quote(self, symbol: str) -> Optional[Quote]:
529
535
  return self._last_quotes[symbol]
530
536
 
qubx/core/basics.py CHANGED
@@ -570,6 +570,12 @@ class SimulatedCtrlChannel(CtrlChannel):
570
570
  def receive(self) -> Any:
571
571
  raise ValueError("This method should not be called in a simulated environment.")
572
572
 
573
+ def stop(self):
574
+ self.control.clear()
575
+
576
+ def start(self):
577
+ self.control.set()
578
+
573
579
 
574
580
  class IComminucationManager:
575
581
  databus: CtrlChannel
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Qubx
3
- Version: 0.2.70
3
+ Version: 0.2.71
4
4
  Summary: Qubx - quantitative trading framework
5
5
  Home-page: https://github.com/dmarienko/Qubx
6
6
  Author: Dmitry Marienko
@@ -4,22 +4,22 @@ qubx/backtester/__init__.py,sha256=g9K4pp4ieY4rRKE0eA_02LMo-c4vnk-QqtVn_ff9F5U,6
4
4
  qubx/backtester/ome.py,sha256=i6J4B4K_LS-3-HhbmtwNJu-NyORZLA7NGlUqdb_EiYQ,10853
5
5
  qubx/backtester/optimization.py,sha256=wn48ppzziiNTG37tipY4HfRpqLKl2Y5iVCVO6NsCKRM,6588
6
6
  qubx/backtester/queue.py,sha256=ys9tHyrqx3NKbcoTAoOn0m0caIk5F0GpS2x7_sCikro,14997
7
- qubx/backtester/simulator.py,sha256=nDwQ7nGt6PW_UHtuKJY00iqlOo3AjrIkXhX4ngzJSxk,34108
7
+ qubx/backtester/simulator.py,sha256=6sftpEmA9mwIOVvvMKAO7wid84LpRTagkSH8Z69qE2I,34252
8
8
  qubx/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  qubx/core/account.py,sha256=uIU-EUMuH5owWhHTmU1pZ0WrkQkiv9YiFqSZW9dFDK8,9066
10
- qubx/core/basics.py,sha256=9SOhYiZq5IsClGc0MdHO3KM_SGyFvJy1imgeZRRfjtg,21703
10
+ qubx/core/basics.py,sha256=WA6LrmCG1si6pfyvezLRkfts575912AhGJMVbwBWSa0,21802
11
11
  qubx/core/context.py,sha256=WnHsItJ1OQ2jD0cHbYOMQ9ck4txLTwtf8Dp-zCLsUww,37759
12
12
  qubx/core/exceptions.py,sha256=W1gG_0fE3o2EMGUfOeOl3vVJDp8Z1iHLv4iZ0ThNkTs,306
13
13
  qubx/core/helpers.py,sha256=JAB1kcKO8l--gxg9_W2BzWW1N4x72sicw1oBszKYcbo,12657
14
14
  qubx/core/loggers.py,sha256=zpehm2-RdKG1ISe6t3DiM3RrL_zzGni3YFcxfgDkV24,16575
15
15
  qubx/core/lookups.py,sha256=qGOSb2SIxmgVPGJFLJnPDI1P9hCzFMVipRDcVLUm8qk,14599
16
16
  qubx/core/metrics.py,sha256=pL1obxnk8I7bDF41bQcOZ7MDsq4Wmj6g5cRiV7cFZKQ,38657
17
- qubx/core/series.cpython-311-x86_64-linux-gnu.so,sha256=MBbJM6pkp8I6FHCKYQy3PfmRAx58P9MRgmzRYisMHHo,779016
17
+ qubx/core/series.cpython-311-x86_64-linux-gnu.so,sha256=LxclD5HJ7eN6N1zVTPjj-GWEqwzPZGBwtHjEBm9lLsE,779016
18
18
  qubx/core/series.pxd,sha256=kF7QeLFgCM-C2hDxVvJM97ZOmyw1v7JEI9WfPKtQ6xs,3002
19
19
  qubx/core/series.pyi,sha256=QeOSi57-NxHEfiP-i7IImf-06KrqSHob5dr6kp45mM4,2603
20
20
  qubx/core/series.pyx,sha256=UhZsnT7R3-UED05Fnp3mGxr4RSdMpWAHB4lkcz46MFo,32598
21
21
  qubx/core/strategy.py,sha256=tTXhDbFTH63yj53mLgVEDBZxYOxC51prcsyXWkdTgLs,10991
22
- qubx/core/utils.cpython-311-x86_64-linux-gnu.so,sha256=O86lbSsB9GOEQ-LWUIMLCUvyEEEc-BMSK5wYbqH5_zU,82504
22
+ qubx/core/utils.cpython-311-x86_64-linux-gnu.so,sha256=75YzBcsX3kau9_GAflGai2X6Xc-sedZpFaKGk1jUcmw,82504
23
23
  qubx/core/utils.pyi,sha256=DAjyRVPJSxK4Em-9wui2F0yYHfP5tI5DjKavXNOnHa8,276
24
24
  qubx/core/utils.pyx,sha256=-8ek58CrbqWZq0-OY7WSREsCXBoBeWrD_wEYbIBS9rI,1696
25
25
  qubx/data/helpers.py,sha256=A0NGzhpXYWD92-GeB8TghwMnR0NW8bjcNJOCXybQw3g,782
@@ -35,7 +35,7 @@ qubx/pandaz/__init__.py,sha256=Iw5uzicYGSC3FEKZ-W1O5-7cXq_P0kH11-EcXV0zZhs,175
35
35
  qubx/pandaz/ta.py,sha256=NthiiueUoqWGRcjovcKKThcCcdImZn3JRdWDA2vL28k,85075
36
36
  qubx/pandaz/utils.py,sha256=XB28Zwv3cXWbKFXbcV5QGj_d6w-i8Yo4LYkX8aPuCHo,19613
37
37
  qubx/ta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- qubx/ta/indicators.cpython-311-x86_64-linux-gnu.so,sha256=VcXW5JKSl6PTfE9FIXCyQfYRlNezHSrYMahADOtTfQI,576168
38
+ qubx/ta/indicators.cpython-311-x86_64-linux-gnu.so,sha256=0bwm5XuLdNT-oT7rDRKwkRpMzxMAAUv_lOwCcisRpQU,576168
39
39
  qubx/ta/indicators.pxd,sha256=YzPDhbbNPmy3m4NafwIRF5sNFsmkq-MM1gbeAygtBwM,4007
40
40
  qubx/ta/indicators.pyi,sha256=mM_7ISmGQDgjhwxCoZXDw7Rm9fynQSYjevV7fRoLdNc,1683
41
41
  qubx/ta/indicators.pyx,sha256=GuxB63YApFnA9IWNJDbBt90J1sOoxTf3jDWYQ3uD9So,24306
@@ -53,6 +53,6 @@ qubx/utils/misc.py,sha256=Av0mhrPCy5NZRrRmjOAhTKusa8wVdL7vCQtEy9bVnz4,10450
53
53
  qubx/utils/ntp.py,sha256=LZo4FPVY3rqLUV9VWkLcZaPOpUDFC8Qleynmfggg9No,1758
54
54
  qubx/utils/runner.py,sha256=Czo01KUCc9Oj9TIcs03d6Qh7fOpQV5w8oH6UDZ6Yqn0,9539
55
55
  qubx/utils/time.py,sha256=ioIos3VLA-iYI8LiQIn2m-t0Y37CEQAHFw_-C9Uwo0o,5188
56
- qubx-0.2.70.dist-info/METADATA,sha256=9TR9KbFamJCbpShZLxQV6XvV8Hkbk2CqTEDRFB9WaQI,2573
57
- qubx-0.2.70.dist-info/WHEEL,sha256=MLOa6LysROdjgj4FVxsHitAnIh8Be2D_c9ZSBHKrz2M,110
58
- qubx-0.2.70.dist-info/RECORD,,
56
+ qubx-0.2.71.dist-info/METADATA,sha256=IY-PJnZMdx6sQ9lbdc2tQUTllelser8FFl3f16jx6Nc,2573
57
+ qubx-0.2.71.dist-info/WHEEL,sha256=MLOa6LysROdjgj4FVxsHitAnIh8Be2D_c9ZSBHKrz2M,110
58
+ qubx-0.2.71.dist-info/RECORD,,
File without changes