Qubx 0.5.7__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.

Files changed (100) hide show
  1. qubx/__init__.py +207 -0
  2. qubx/_nb_magic.py +100 -0
  3. qubx/backtester/__init__.py +5 -0
  4. qubx/backtester/account.py +145 -0
  5. qubx/backtester/broker.py +87 -0
  6. qubx/backtester/data.py +296 -0
  7. qubx/backtester/management.py +378 -0
  8. qubx/backtester/ome.py +296 -0
  9. qubx/backtester/optimization.py +201 -0
  10. qubx/backtester/simulated_data.py +558 -0
  11. qubx/backtester/simulator.py +362 -0
  12. qubx/backtester/utils.py +780 -0
  13. qubx/cli/__init__.py +0 -0
  14. qubx/cli/commands.py +67 -0
  15. qubx/connectors/ccxt/__init__.py +0 -0
  16. qubx/connectors/ccxt/account.py +495 -0
  17. qubx/connectors/ccxt/broker.py +132 -0
  18. qubx/connectors/ccxt/customizations.py +193 -0
  19. qubx/connectors/ccxt/data.py +612 -0
  20. qubx/connectors/ccxt/exceptions.py +17 -0
  21. qubx/connectors/ccxt/factory.py +93 -0
  22. qubx/connectors/ccxt/utils.py +307 -0
  23. qubx/core/__init__.py +0 -0
  24. qubx/core/account.py +251 -0
  25. qubx/core/basics.py +850 -0
  26. qubx/core/context.py +420 -0
  27. qubx/core/exceptions.py +38 -0
  28. qubx/core/helpers.py +480 -0
  29. qubx/core/interfaces.py +1150 -0
  30. qubx/core/loggers.py +514 -0
  31. qubx/core/lookups.py +475 -0
  32. qubx/core/metrics.py +1512 -0
  33. qubx/core/mixins/__init__.py +13 -0
  34. qubx/core/mixins/market.py +94 -0
  35. qubx/core/mixins/processing.py +428 -0
  36. qubx/core/mixins/subscription.py +203 -0
  37. qubx/core/mixins/trading.py +88 -0
  38. qubx/core/mixins/universe.py +270 -0
  39. qubx/core/series.cpython-312-x86_64-linux-gnu.so +0 -0
  40. qubx/core/series.pxd +125 -0
  41. qubx/core/series.pyi +118 -0
  42. qubx/core/series.pyx +988 -0
  43. qubx/core/utils.cpython-312-x86_64-linux-gnu.so +0 -0
  44. qubx/core/utils.pyi +6 -0
  45. qubx/core/utils.pyx +62 -0
  46. qubx/data/__init__.py +25 -0
  47. qubx/data/helpers.py +416 -0
  48. qubx/data/readers.py +1562 -0
  49. qubx/data/tardis.py +100 -0
  50. qubx/gathering/simplest.py +88 -0
  51. qubx/math/__init__.py +3 -0
  52. qubx/math/stats.py +129 -0
  53. qubx/pandaz/__init__.py +23 -0
  54. qubx/pandaz/ta.py +2757 -0
  55. qubx/pandaz/utils.py +638 -0
  56. qubx/resources/instruments/symbols-binance.cm.json +1 -0
  57. qubx/resources/instruments/symbols-binance.json +1 -0
  58. qubx/resources/instruments/symbols-binance.um.json +1 -0
  59. qubx/resources/instruments/symbols-bitfinex.f.json +1 -0
  60. qubx/resources/instruments/symbols-bitfinex.json +1 -0
  61. qubx/resources/instruments/symbols-kraken.f.json +1 -0
  62. qubx/resources/instruments/symbols-kraken.json +1 -0
  63. qubx/ta/__init__.py +0 -0
  64. qubx/ta/indicators.cpython-312-x86_64-linux-gnu.so +0 -0
  65. qubx/ta/indicators.pxd +149 -0
  66. qubx/ta/indicators.pyi +41 -0
  67. qubx/ta/indicators.pyx +787 -0
  68. qubx/trackers/__init__.py +3 -0
  69. qubx/trackers/abvanced.py +236 -0
  70. qubx/trackers/composite.py +146 -0
  71. qubx/trackers/rebalancers.py +129 -0
  72. qubx/trackers/riskctrl.py +641 -0
  73. qubx/trackers/sizers.py +235 -0
  74. qubx/utils/__init__.py +5 -0
  75. qubx/utils/_pyxreloader.py +281 -0
  76. qubx/utils/charting/lookinglass.py +1057 -0
  77. qubx/utils/charting/mpl_helpers.py +1183 -0
  78. qubx/utils/marketdata/binance.py +284 -0
  79. qubx/utils/marketdata/ccxt.py +90 -0
  80. qubx/utils/marketdata/dukas.py +130 -0
  81. qubx/utils/misc.py +541 -0
  82. qubx/utils/ntp.py +63 -0
  83. qubx/utils/numbers_utils.py +7 -0
  84. qubx/utils/orderbook.py +491 -0
  85. qubx/utils/plotting/__init__.py +0 -0
  86. qubx/utils/plotting/dashboard.py +150 -0
  87. qubx/utils/plotting/data.py +137 -0
  88. qubx/utils/plotting/interfaces.py +25 -0
  89. qubx/utils/plotting/renderers/__init__.py +0 -0
  90. qubx/utils/plotting/renderers/plotly.py +0 -0
  91. qubx/utils/runner/__init__.py +1 -0
  92. qubx/utils/runner/_jupyter_runner.pyt +60 -0
  93. qubx/utils/runner/accounts.py +88 -0
  94. qubx/utils/runner/configs.py +65 -0
  95. qubx/utils/runner/runner.py +470 -0
  96. qubx/utils/time.py +312 -0
  97. qubx-0.5.7.dist-info/METADATA +105 -0
  98. qubx-0.5.7.dist-info/RECORD +100 -0
  99. qubx-0.5.7.dist-info/WHEEL +4 -0
  100. qubx-0.5.7.dist-info/entry_points.txt +3 -0
qubx/core/series.pyi ADDED
@@ -0,0 +1,118 @@
1
+ from typing import Any, Tuple
2
+
3
+ import numpy as np
4
+ cimport numpy as np
5
+
6
+ import pandas as pd
7
+
8
+ class Bar:
9
+ time: int
10
+ open: float
11
+ high: float
12
+ low: float
13
+ close: float
14
+ volume: float
15
+ bought_volume: float
16
+ def __init__(self, time, open, high, low, close, volume, bought_volume=0): ...
17
+ def update(self, price: float, volume: float, bought_volume: float = 0) -> Bar: ...
18
+ def to_dict(self, skip_time: bool = False) -> dict: ...
19
+
20
+ class Quote:
21
+ time: int
22
+ bid: float
23
+ ask: float
24
+ bid_size: float
25
+ ask_size: float
26
+
27
+ def __init__(self, time, bid, ask, bid_size, ask_size): ...
28
+ def mid_price(self) -> float: ...
29
+
30
+ class Trade:
31
+ time: int
32
+ price: float
33
+ size: float
34
+ taker: int
35
+ trade_id: int
36
+ def __init__(self, time, price, size, taker=-1, trade_id=0): ...
37
+
38
+ class OrderBook:
39
+ time: int
40
+ top_bid: float
41
+ top_ask: float
42
+ tick_size: float
43
+ bids: np.ndarray
44
+ asks: np.ndarray
45
+
46
+ def __init__(self, time, top_bid, top_ask, tick_size, bids, asks): ...
47
+ def to_quote(self) -> Quote: ...
48
+ def mid_price(self) -> float: ...
49
+
50
+
51
+ class Locator:
52
+ def __getitem__(self, idx): ...
53
+ def find(self, t: str) -> Tuple[np.datetime64, Any]: ...
54
+
55
+ class Indexed:
56
+ def __getitem__(self, idx): ...
57
+ def lookup_idx(self, value, method: str) -> int: ...
58
+
59
+ class TimeSeries:
60
+ name: str
61
+ loc: Locator
62
+ timeframe: int
63
+ max_series_length: int
64
+ times: Indexed
65
+ values: Indexed
66
+ def __init__(self, name, timeframe, max_series_length=np.inf, process_every_update=True) -> None: ...
67
+ def __getitem__(self, idx): ...
68
+ def __len__(self) -> int: ...
69
+ def update(self, time: int, value: float) -> bool: ...
70
+ def copy(self, start: int, stop: int) -> "TimeSeries": ...
71
+ def shift(self, period: int) -> TimeSeries: ...
72
+ def get_indicators(self) -> dict: ...
73
+ def plot(self, *args, **kwargs): ...
74
+ def to_records(self) -> dict: ...
75
+ def to_series(self) -> pd.Series: ...
76
+ def pd(self) -> pd.Series: ...
77
+
78
+ class OHLCV(TimeSeries):
79
+ open: TimeSeries
80
+ high: TimeSeries
81
+ low: TimeSeries
82
+ close: TimeSeries
83
+ volume: TimeSeries
84
+ bvolume: TimeSeries
85
+
86
+ def __init__(self, name, timeframe, max_series_length: int | float = np.inf) -> None: ...
87
+ def __len__(self) -> int: ...
88
+ def update(self, time: int, price: float, volume: float = 0.0, bvolume: float = 0.0) -> bool: ...
89
+ def update_by_bar(
90
+ self,
91
+ time: int,
92
+ open: float,
93
+ high: float,
94
+ low: float,
95
+ close: float,
96
+ vol_incr: float = 0.0,
97
+ b_vol_incr: float = 0.0,
98
+ ) -> bool: ...
99
+ def to_records(self) -> dict: ...
100
+ def pd(self) -> pd.DataFrame: ...
101
+ def from_dataframe(df_p: pd.DataFrame, name: str="ohlc") -> OHLCV:...
102
+
103
+ class Indicator(TimeSeries):
104
+ name: str
105
+ series: TimeSeries
106
+
107
+ def update(self, time: int, value, new_item_started: bool) -> object: ...
108
+
109
+ class IndicatorOHLC(Indicator):
110
+ series: OHLCV
111
+ def _copy_internal_series(self, start: int, stop: int, *origins): ...
112
+
113
+ def time_as_nsec(time: Any) -> int: ...
114
+
115
+ class RollingSum:
116
+ is_init_stage: bool
117
+ def __init__(self, period: int) -> None: ...
118
+ def update(self, value: float, new_item_started: bool) -> float: ...