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.

Files changed (68) hide show
  1. {qubx-0.4.2 → qubx-0.4.3}/PKG-INFO +1 -1
  2. {qubx-0.4.2 → qubx-0.4.3}/pyproject.toml +2 -2
  3. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/pandaz/utils.py +7 -2
  4. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/marketdata/binance.py +8 -2
  5. {qubx-0.4.2 → qubx-0.4.3}/README.md +0 -0
  6. {qubx-0.4.2 → qubx-0.4.3}/build.py +0 -0
  7. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/__init__.py +0 -0
  8. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/_nb_magic.py +0 -0
  9. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/__init__.py +0 -0
  10. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/ome.py +0 -0
  11. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/optimization.py +0 -0
  12. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/queue.py +0 -0
  13. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/backtester/simulator.py +0 -0
  14. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/__init__.py +0 -0
  15. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_connector.py +0 -0
  16. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_customizations.py +0 -0
  17. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_exceptions.py +0 -0
  18. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_trading.py +0 -0
  19. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/connectors/ccxt/ccxt_utils.py +0 -0
  20. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/__init__.py +0 -0
  21. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/account.py +0 -0
  22. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/basics.py +0 -0
  23. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/context.py +0 -0
  24. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/exceptions.py +0 -0
  25. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/helpers.py +0 -0
  26. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/interfaces.py +0 -0
  27. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/loggers.py +0 -0
  28. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/lookups.py +0 -0
  29. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/metrics.py +0 -0
  30. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/__init__.py +0 -0
  31. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/market.py +0 -0
  32. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/processing.py +0 -0
  33. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/subscription.py +0 -0
  34. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/trading.py +0 -0
  35. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/mixins/universe.py +0 -0
  36. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/series.pxd +0 -0
  37. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/series.pyi +0 -0
  38. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/series.pyx +0 -0
  39. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/utils.pyi +0 -0
  40. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/core/utils.pyx +0 -0
  41. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/data/__init__.py +0 -0
  42. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/data/helpers.py +0 -0
  43. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/data/readers.py +0 -0
  44. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/gathering/simplest.py +0 -0
  45. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/math/__init__.py +0 -0
  46. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/math/stats.py +0 -0
  47. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/pandaz/__init__.py +0 -0
  48. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/pandaz/ta.py +0 -0
  49. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/ta/__init__.py +0 -0
  50. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/ta/indicators.pxd +0 -0
  51. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/ta/indicators.pyi +0 -0
  52. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/ta/indicators.pyx +0 -0
  53. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/__init__.py +0 -0
  54. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/composite.py +0 -0
  55. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/rebalancers.py +0 -0
  56. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/riskctrl.py +0 -0
  57. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/trackers/sizers.py +0 -0
  58. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/__init__.py +0 -0
  59. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/_pyxreloader.py +0 -0
  60. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/charting/lookinglass.py +0 -0
  61. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/charting/mpl_helpers.py +0 -0
  62. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/collections.py +0 -0
  63. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/misc.py +0 -0
  64. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/ntp.py +0 -0
  65. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/orderbook.py +0 -0
  66. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/runner.py +0 -0
  67. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/threading.py +0 -0
  68. {qubx-0.4.2 → qubx-0.4.3}/src/qubx/utils/time.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Qubx
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: Qubx - quantitative trading framework
5
5
  Home-page: https://github.com/dmarienko/Qubx
6
6
  Author: Dmitry Marienko
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "Qubx"
3
- version = "0.4.2"
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 pd.Timestamp(end) - pd.Timestamp(start) < freq * pd.Timedelta(f"1{units}"):
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
- with open(fpath, "wb") as handle:
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