Qubx 0.4.2__tar.gz → 0.4.3__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.4.2 → qubx-0.4.3}/PKG-INFO +1 -1
- {qubx-0.4.2 → qubx-0.4.3}/pyproject.toml +2 -2
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/pandaz/utils.py +7 -2
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/marketdata/binance.py +8 -2
- {qubx-0.4.2 → qubx-0.4.3}/README.md +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/build.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/_nb_magic.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/ome.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/optimization.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/queue.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/simulator.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_connector.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_customizations.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_exceptions.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_trading.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_utils.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/account.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/basics.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/context.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/exceptions.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/helpers.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/interfaces.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/loggers.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/lookups.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/metrics.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/market.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/processing.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/subscription.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/trading.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/universe.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/series.pxd +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/series.pyi +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/series.pyx +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/utils.pyi +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/utils.pyx +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/data/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/data/helpers.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/data/readers.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/gathering/simplest.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/math/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/math/stats.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/pandaz/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/pandaz/ta.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/ta/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/ta/indicators.pxd +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/ta/indicators.pyi +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/ta/indicators.pyx +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/composite.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/rebalancers.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/riskctrl.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/sizers.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/__init__.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/_pyxreloader.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/charting/lookinglass.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/charting/mpl_helpers.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/collections.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/misc.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/ntp.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/orderbook.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/runner.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/threading.py +0 -0
- {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/time.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "Qubx"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.3"
|
|
4
4
|
description = "Qubx - quantitative trading framework"
|
|
5
5
|
authors = ["Dmitry Marienko <dmitry@gmail.com>", "Yuriy Arabskyy <yuriy.arabskyy@gmail.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -73,4 +73,4 @@ pytest-mock = "*"
|
|
|
73
73
|
pythonpath = ["src"]
|
|
74
74
|
filterwarnings = [
|
|
75
75
|
"ignore:.*Jupyter is migrating.*:DeprecationWarning",
|
|
76
|
-
]
|
|
76
|
+
]
|
|
@@ -90,7 +90,7 @@ def rolling_forward_test_split(
|
|
|
90
90
|
yield (np.array(range(i - training_period, i)), np.array(range(i, i + test_period)))
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
def generate_equal_date_ranges(start: str, end: str, freq, units):
|
|
93
|
+
def generate_equal_date_ranges(start: str | pd.Timestamp, end: str | pd.Timestamp, freq, units):
|
|
94
94
|
"""
|
|
95
95
|
Generator for date ranges:
|
|
96
96
|
|
|
@@ -103,7 +103,12 @@ def generate_equal_date_ranges(start: str, end: str, freq, units):
|
|
|
103
103
|
2022-01-01 2022-05-17
|
|
104
104
|
"""
|
|
105
105
|
_as_f = lambda x: pd.Timestamp(x).strftime("%Y-%m-%d")
|
|
106
|
-
if
|
|
106
|
+
if units in ["M", "Y"]:
|
|
107
|
+
offset = pd.DateOffset(years=freq) if units == "Y" else pd.DateOffset(months=freq)
|
|
108
|
+
else:
|
|
109
|
+
offset = pd.Timedelta(f"{freq}{units}")
|
|
110
|
+
|
|
111
|
+
if pd.Timestamp(end) - offset < pd.Timestamp(start):
|
|
107
112
|
b = [start, end]
|
|
108
113
|
|
|
109
114
|
for a, b in rolling_forward_test_split(pd.Series(0, pd.date_range(start, end)), freq, freq, units=units):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from typing import Any, Callable, Dict, List, Tuple
|
|
2
3
|
from os import unlink
|
|
3
4
|
import numpy as np
|
|
@@ -57,13 +58,18 @@ def fetch_file(url, local_file_storage, chunk_size=1024*1024, progress_bar=True)
|
|
|
57
58
|
# if dest location not exists create it
|
|
58
59
|
if not exists(local_file_storage):
|
|
59
60
|
makedirs(local_file_storage)
|
|
60
|
-
|
|
61
|
+
|
|
61
62
|
response = requests.get(url, stream=True)
|
|
63
|
+
if response.status_code != 200:
|
|
64
|
+
logger.warning(f"Error while fetching {url}: {response.status_code}")
|
|
65
|
+
return None
|
|
62
66
|
fpath = join(local_file_storage, file)
|
|
63
|
-
|
|
67
|
+
fpath_temp = join(local_file_storage, f"{file}_tmp")
|
|
68
|
+
with open(fpath_temp, "wb") as handle:
|
|
64
69
|
iters = response.iter_content(chunk_size=chunk_size)
|
|
65
70
|
for data in tqdm(iters) if progress_bar else iters:
|
|
66
71
|
handle.write(data)
|
|
72
|
+
os.rename(fpath_temp, fpath)
|
|
67
73
|
return fpath
|
|
68
74
|
|
|
69
75
|
|
|
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
|
|
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
|