Qubx 0.2.81__tar.gz → 0.2.82__tar.gz
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.
- {qubx-0.2.81 → qubx-0.2.82}/PKG-INFO +1 -1
- {qubx-0.2.81 → qubx-0.2.82}/pyproject.toml +1 -1
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/data/helpers.py +5 -3
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/pandaz/utils.py +10 -7
- {qubx-0.2.81 → qubx-0.2.82}/README.md +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/build.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/_nb_magic.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/backtester/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/backtester/ome.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/backtester/optimization.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/backtester/queue.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/backtester/simulator.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/account.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/basics.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/context.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/exceptions.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/helpers.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/loggers.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/lookups.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/metrics.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/series.pxd +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/series.pyi +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/series.pyx +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/strategy.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/utils.pyi +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/core/utils.pyx +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/data/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/data/readers.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/gathering/simplest.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/impl/ccxt_connector.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/impl/ccxt_customizations.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/impl/ccxt_trading.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/impl/ccxt_utils.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/math/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/math/stats.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/pandaz/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/pandaz/ta.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/ta/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/ta/indicators.pxd +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/ta/indicators.pyi +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/ta/indicators.pyx +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/trackers/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/trackers/composite.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/trackers/rebalancers.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/trackers/riskctrl.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/trackers/sizers.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/__init__.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/_pyxreloader.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/charting/lookinglass.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/charting/mpl_helpers.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/marketdata/binance.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/misc.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/ntp.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/runner.py +0 -0
- {qubx-0.2.81 → qubx-0.2.82}/src/qubx/utils/time.py +0 -0
|
@@ -166,9 +166,11 @@ class InMemoryCachedReader(InMemoryDataFrameReader):
|
|
|
166
166
|
for (s, e), data in zip(_ranges, _results):
|
|
167
167
|
assert isinstance(data, pd.DataFrame)
|
|
168
168
|
try:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
# - some periods of data may be empty so just skipping it to avoid error log
|
|
170
|
+
if not data.empty:
|
|
171
|
+
data_symbols = data.index.get_level_values(1).unique()
|
|
172
|
+
for smb in data_symbols:
|
|
173
|
+
_ohlcs[smb].append(data.loc[pd.IndexSlice[:, smb], :].droplevel(1))
|
|
172
174
|
except Exception as exc:
|
|
173
175
|
logger.error(f"> Failed to load data for {s} - {e} : {str(exc)}")
|
|
174
176
|
|
|
@@ -5,7 +5,7 @@ import numpy as np
|
|
|
5
5
|
|
|
6
6
|
from numpy.lib.stride_tricks import as_strided as stride
|
|
7
7
|
|
|
8
|
-
from qubx.utils.misc import Struct
|
|
8
|
+
from qubx.utils.misc import Struct
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def has_columns(x, *args):
|
|
@@ -572,16 +572,20 @@ class OhlcDict(dict):
|
|
|
572
572
|
_fields: Set[str]
|
|
573
573
|
|
|
574
574
|
def __init__(self, orig: dict):
|
|
575
|
+
_o_copy = {}
|
|
575
576
|
if isinstance(orig, dict):
|
|
576
577
|
_lst = []
|
|
577
578
|
for k, o in orig.items():
|
|
578
|
-
# if not k[0].isalpha():
|
|
579
|
-
# raise ValueError("Keys in the dictionary must start with an alphabet")
|
|
580
579
|
if not isinstance(o, (pd.DataFrame | pd.Series)):
|
|
581
|
-
raise ValueError(
|
|
582
|
-
|
|
580
|
+
raise ValueError(
|
|
581
|
+
f"All values in the dictionary must be pandas Series or DataFrames, but {k} is {type(o)}"
|
|
582
|
+
)
|
|
583
|
+
# - skip empty data
|
|
584
|
+
if not o.empty:
|
|
585
|
+
_o_copy[k] = o
|
|
586
|
+
_lst.extend(o.columns.values)
|
|
583
587
|
self._fields = set(_lst)
|
|
584
|
-
super().__init__(
|
|
588
|
+
super().__init__(_o_copy)
|
|
585
589
|
|
|
586
590
|
def __call__(self, *args: Any, **kwds: Any) -> Any:
|
|
587
591
|
if args:
|
|
@@ -592,7 +596,6 @@ class OhlcDict(dict):
|
|
|
592
596
|
return self
|
|
593
597
|
|
|
594
598
|
def __getattribute__(self, name: str) -> Any:
|
|
595
|
-
|
|
596
599
|
if name != "_fields":
|
|
597
600
|
if name in self._fields:
|
|
598
601
|
return retain_columns_and_join(self, name)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|