Qubx 0.6.29__cp312-cp312-manylinux_2_39_x86_64.whl → 0.6.30__cp312-cp312-manylinux_2_39_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.

@@ -616,9 +616,10 @@ class CcxtDataProvider(IDataProvider):
616
616
  for exch_symbol, ccxt_ticker in ccxt_tickers.items(): # type: ignore
617
617
  instrument = ccxt_find_instrument(exch_symbol, self._exchange, _symbol_to_instrument)
618
618
  quote = ccxt_convert_ticker(ccxt_ticker)
619
- self._health_monitor.record_data_arrival(sub_type, dt_64(quote.time, "ns"))
620
- self._last_quotes[instrument] = quote
621
- channel.send((instrument, sub_type, quote, False))
619
+ if self._last_quotes[instrument] is None or quote.time > self._last_quotes[instrument].time:
620
+ self._health_monitor.record_data_arrival(sub_type, dt_64(quote.time, "ns"))
621
+ self._last_quotes[instrument] = quote
622
+ channel.send((instrument, sub_type, quote, False))
622
623
 
623
624
  async def un_watch_quote(instruments: list[Instrument]):
624
625
  symbols = [_instr_to_ccxt_symbol[i] for i in instruments]
qubx/core/context.py CHANGED
@@ -430,8 +430,8 @@ class StrategyContext(IStrategyContext):
430
430
  def close_positions(self, market_type: MarketType | None = None) -> None:
431
431
  return self._trading_manager.close_positions(market_type)
432
432
 
433
- def cancel_order(self, order_id: str) -> None:
434
- return self._trading_manager.cancel_order(order_id)
433
+ def cancel_order(self, order_id: str, exchange: str | None = None) -> None:
434
+ return self._trading_manager.cancel_order(order_id, exchange)
435
435
 
436
436
  def cancel_orders(self, instrument: Instrument):
437
437
  return self._trading_manager.cancel_orders(instrument)
qubx/core/helpers.py CHANGED
@@ -202,6 +202,8 @@ class CachedMarketDataHolder:
202
202
  series = self._ohlcvs.get(instrument)
203
203
  if series:
204
204
  for ser in series.values():
205
+ if len(ser) > 0 and ser[0].time > quote.time:
206
+ continue
205
207
  ser.update(quote.time, quote.mid_price(), 0)
206
208
 
207
209
  @SW.watch("CachedMarketDataHolder")
qubx/data/tardis.py CHANGED
@@ -529,6 +529,7 @@ class TardisMachineReader(DataReader):
529
529
  raise ValueError(f"Invalid data_id format: {data_id}. Expected format: 'exchange:symbol'")
530
530
 
531
531
  exchange = TARDIS_EXCHANGE_MAPPERS.get(exchange.lower(), exchange)
532
+ symbol = self._map_symbol(symbol, exchange)
532
533
 
533
534
  start_date, end_date = handle_start_stop(start, stop)
534
535
  if not start_date:
@@ -607,6 +608,7 @@ class TardisMachineReader(DataReader):
607
608
  try:
608
609
  chunk = chunk_queue.get()
609
610
  if chunk is None: # End of chunks
611
+ logger.info(f"End of chunks for {data_id}")
610
612
  break
611
613
 
612
614
  # Process and yield the chunk
@@ -877,3 +879,10 @@ class TardisMachineReader(DataReader):
877
879
  def _stream_data(self, url: str, line_queue: Queue, stop_event: threading.Event):
878
880
  """Submit the streaming coroutine to the asyncio loop"""
879
881
  return self._async_loop.submit(self._fetch_stream(url, line_queue, stop_event))
882
+
883
+ def _map_symbol(self, symbol: str, exchange: str) -> str:
884
+ """Map symbol to Tardis Machine API format"""
885
+ if exchange.lower() == "bitfinex-derivatives":
886
+ return f"{symbol[:3]}F0:USTF0"
887
+ else:
888
+ return symbol
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: Qubx
3
- Version: 0.6.29
3
+ Version: 0.6.30
4
4
  Summary: Qubx - Quantitative Trading Framework
5
5
  Author: Dmitry Marienko
6
6
  Author-email: dmitry.marienko@xlydian.com
@@ -20,7 +20,7 @@ qubx/cli/release.py,sha256=JYdNt_ZM9jarmYiRDtKqbRqqllzm2Qwi6VggokB2j8A,28167
20
20
  qubx/connectors/ccxt/__init__.py,sha256=HEQ7lM9HS8sED_zfsAHrhFT7F9E7NFGAecwZwNr-TDE,65
21
21
  qubx/connectors/ccxt/account.py,sha256=HILqsSPfor58NrlP0qYwO5lkNZzUBG-SR5Hy1OSa7_M,24308
22
22
  qubx/connectors/ccxt/broker.py,sha256=UMAytmDCwELUv4-R4WmrEQdPnZjjF89XlgJst15WVSs,15305
23
- qubx/connectors/ccxt/data.py,sha256=-5ysiERXC6Ip5Hp9N6Lq4bTQVyMZvFFMMPcS6RfwmYk,30051
23
+ qubx/connectors/ccxt/data.py,sha256=COVUh37ZdCUjiDB0a38Cj9SNSV8P95mqG2B3Gc_fQ2U,30172
24
24
  qubx/connectors/ccxt/exceptions.py,sha256=OfZc7iMdEG8uLorcZta2NuEuJrSIqi0FG7IICmwF54M,262
25
25
  qubx/connectors/ccxt/exchanges/__init__.py,sha256=2Po4YfvLOcpXHCS9Q2SSy3TMUejkcd9RhQ-oyGaxcEc,1504
26
26
  qubx/connectors/ccxt/exchanges/binance/broker.py,sha256=BB2V82zaOm1EjP3GrsOqQQMeGpml6-w23iv7goKrjyU,2111
@@ -35,11 +35,11 @@ qubx/connectors/tardis/utils.py,sha256=epThu9DwqbDb7BgScH6fHa_FVpKUaItOqp3JwtKGc
35
35
  qubx/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  qubx/core/account.py,sha256=4_XskMLR9Uh-rpJBDYMrceYiGMvAZw56k1ve-unIW8w,19417
37
37
  qubx/core/basics.py,sha256=PaprFa6sscrYPZfxImWOPLfVoVlu3PtcXTWbz0ZMtEk,28864
38
- qubx/core/context.py,sha256=-kzDxzsZtu2kO1eBxi5iVUoSmWB3tIZOp4JTCiEZZE0,22277
38
+ qubx/core/context.py,sha256=R6otCA09Eqb4d0xA-HOGDAv4NjpLwJc3RzLs4QHXzg4,22316
39
39
  qubx/core/deque.py,sha256=3PsmJ5LF76JpsK4Wp5LLogyE15rKn6EDCkNOOWT6EOk,6203
40
40
  qubx/core/errors.py,sha256=kWCK6o0-mm87VUhhlGKqwTpvdDXAza7YRRjeyz-vwfI,609
41
41
  qubx/core/exceptions.py,sha256=11wQC3nnNLsl80zBqbE6xiKCqm31kctqo6W_gdnZkg8,581
42
- qubx/core/helpers.py,sha256=9nl9L_ZzT1HsMC9VthMqXfmuRS_37crB-9bVfIRHeOs,19631
42
+ qubx/core/helpers.py,sha256=qzRsttt4sMYMarDWMzWvc3b2W-Qp9qAQwFiQBljAsA0,19722
43
43
  qubx/core/initializer.py,sha256=PUiD_cIjvGpuPjYyRpUjpwm3xNQ2Kipa8bAhbtxCQRo,3935
44
44
  qubx/core/interfaces.py,sha256=VKIgEhRaDj9EMf1UUcMlai2BLrw0UNPU1-2akU5q0Ng,57955
45
45
  qubx/core/loggers.py,sha256=eYhJANHYwz1heeFMa5V7jYCL196wkTSvj6c-8lkPj1Y,19567
@@ -51,11 +51,11 @@ qubx/core/mixins/processing.py,sha256=dqehukrfqcLy5BeILKnkpHCvva4SbLKj1ZbQdnByu1
51
51
  qubx/core/mixins/subscription.py,sha256=V_g9wCPQ8S5SHkU-qOZ84cV5nReAUrV7DoSNAGG0LPY,10372
52
52
  qubx/core/mixins/trading.py,sha256=6XK712ZHECZnI-lleJfQ8taXfaBagPQBVqNoBxAkEyM,7204
53
53
  qubx/core/mixins/universe.py,sha256=L3s2Jw46_J1iDh4622Gk_LvCjol4W7mflBwEHrLfZEw,9899
54
- qubx/core/series.cpython-312-x86_64-linux-gnu.so,sha256=fsbUVYNqAS42tjo3ZbPvyXTUO9hw1d-9nZcIXepfd4U,978280
54
+ qubx/core/series.cpython-312-x86_64-linux-gnu.so,sha256=tqo8lBc1v1fsfExyomqrV6EExYDa5NeyxcgT2RG8A5Y,978280
55
55
  qubx/core/series.pxd,sha256=jBdMwgO8J4Zrue0e_xQ5RlqTXqihpzQNu6V3ckZvvpY,3978
56
56
  qubx/core/series.pyi,sha256=RaHm_oHHiWiNUMJqVfx5FXAXniGLsHxUFOUpacn7GC0,4604
57
57
  qubx/core/series.pyx,sha256=7cM3zZThW59waHiYcZmMxvYj-HYD7Ej_l7nKA4emPjE,46477
58
- qubx/core/utils.cpython-312-x86_64-linux-gnu.so,sha256=0AJgqHjRH-SBlVonHtpvhHITa0qCj-AxpT6ZHZOSHrA,86568
58
+ qubx/core/utils.cpython-312-x86_64-linux-gnu.so,sha256=hBgSBMWNTQX0D4sWQdHD42SJ8GJ6P3rIZ7fsOY52M00,86568
59
59
  qubx/core/utils.pyi,sha256=a-wS13V2p_dM1CnGq40JVulmiAhixTwVwt0ah5By0Hc,348
60
60
  qubx/core/utils.pyx,sha256=k5QHfEFvqhqWfCob89ANiJDKNG8gGbOh-O4CVoneZ8M,1696
61
61
  qubx/data/__init__.py,sha256=ELZykvpPGWc5rX7QoNyNQwMLgdKMG8MACOByA4pM5hA,549
@@ -64,7 +64,7 @@ qubx/data/helpers.py,sha256=VcXBl1kfWzAOqrjadKrP9WemGjJIB0q3xascbesErh4,16268
64
64
  qubx/data/hft.py,sha256=Y1QVg3eXDt9ZtdnrNk7xreblEa0Mc4Jrprt0dVaoOn0,32797
65
65
  qubx/data/readers.py,sha256=Y6bU4jyeRGB9mPdQwi9dD0PTuiQH-OVAY9N-6cM3HVo,62527
66
66
  qubx/data/registry.py,sha256=45mjy5maBSO6cf-0zfIRRDs8b0VDW7wHSPn43aRjv-o,3883
67
- qubx/data/tardis.py,sha256=aQeNKUu2jKQpTSRyzCtTqDhxWW8hUp2If7Yr5mMaaYA,33360
67
+ qubx/data/tardis.py,sha256=VMw13tIIlrGZwermKvdFRSNtLUiJDGOKW4l6WuAMQSA,33747
68
68
  qubx/emitters/__init__.py,sha256=tpJ9OoW-gycTBXGJ0647tT8-dVBmq23T2wMX_kmk3nM,565
69
69
  qubx/emitters/base.py,sha256=z0CiEnIGkizd-4Btvq9Auxg3BpnkKN6M8-ksAH2enQc,7745
70
70
  qubx/emitters/composite.py,sha256=8DsPIUtaJ95Oww9QTVVB6LR7Wcb6TJ-c1jIHMGuttz4,2784
@@ -116,7 +116,7 @@ qubx/restorers/signal.py,sha256=DBLqA7vDhoMTAzUC4N9UerrO0GbjeHdTeMoCz7U7iI8,6621
116
116
  qubx/restorers/state.py,sha256=duXyEHQhS1zdNdo3VKscMhieZ5sYNlfE4S_pPXQ1Tuw,4109
117
117
  qubx/restorers/utils.py,sha256=We2gfqwQKWziUYhuUnjb-xo-5tSlbuHWpPQn0CEMTn0,1155
118
118
  qubx/ta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
119
- qubx/ta/indicators.cpython-312-x86_64-linux-gnu.so,sha256=Mss8usOoL6hmmXTTcoOH5yIUN0bRcFOEgWYsIueYlRo,654440
119
+ qubx/ta/indicators.cpython-312-x86_64-linux-gnu.so,sha256=bILNsZrjMikfxgSeCxMuPgKOtAlvPZ2wsXLekHFrTAg,654440
120
120
  qubx/ta/indicators.pxd,sha256=Goo0_N0Xnju8XGo3Xs-3pyg2qr_0Nh5C-_26DK8U_IE,4224
121
121
  qubx/ta/indicators.pyi,sha256=19W0uERft49In5bf9jkJHkzJYEyE9gzudN7_DJ5Vdv8,1963
122
122
  qubx/ta/indicators.pyx,sha256=Xgpew46ZxSXsdfSEWYn3A0Q35MLsopB9n7iyCsXTufs,25969
@@ -153,8 +153,8 @@ qubx/utils/runner/factory.py,sha256=vQ2dBTbrQE9YH__-TvuFzGF-E1li-vt_qQum9GHa11g,
153
153
  qubx/utils/runner/runner.py,sha256=iJsxTU9ne43Seh5rMfZLrXnV-RtA4BwzZYsjHeXajLs,29067
154
154
  qubx/utils/time.py,sha256=J0ZFGjzFL5T6GA8RPAel8hKG0sg2LZXeQ5YfDCfcMHA,10055
155
155
  qubx/utils/version.py,sha256=e52fIHyxzCiIuH7svCF6pkHuDlqL64rklqz-2XjWons,5309
156
- qubx-0.6.29.dist-info/LICENSE,sha256=qwMHOSJ2TD0nx6VUJvFhu1ynJdBfNozRMt6tnSul-Ts,35140
157
- qubx-0.6.29.dist-info/METADATA,sha256=a7FpGiZmBlGzYdt3GrAuWr6skM_ow-yWuAkZHmCiBTM,4444
158
- qubx-0.6.29.dist-info/WHEEL,sha256=XjdW4AGUgFDhpG9b3b2KPhtR_JLZvHyfemLgJJwcqOI,110
159
- qubx-0.6.29.dist-info/entry_points.txt,sha256=VqilDTe8mVuV9SbR-yVlZJBTjbkHIL2JBgXfQw076HY,47
160
- qubx-0.6.29.dist-info/RECORD,,
156
+ qubx-0.6.30.dist-info/LICENSE,sha256=qwMHOSJ2TD0nx6VUJvFhu1ynJdBfNozRMt6tnSul-Ts,35140
157
+ qubx-0.6.30.dist-info/METADATA,sha256=oE-cnQjyrtY7PeSVMWN91kwDDiFm0dZkTaTr829lWkM,4444
158
+ qubx-0.6.30.dist-info/WHEEL,sha256=XjdW4AGUgFDhpG9b3b2KPhtR_JLZvHyfemLgJJwcqOI,110
159
+ qubx-0.6.30.dist-info/entry_points.txt,sha256=VqilDTe8mVuV9SbR-yVlZJBTjbkHIL2JBgXfQw076HY,47
160
+ qubx-0.6.30.dist-info/RECORD,,
File without changes
File without changes