Qubx 0.2.62__cp311-cp311-manylinux_2_35_x86_64.whl → 0.2.64__cp311-cp311-manylinux_2_35_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.
- qubx/core/basics.py +1 -0
- qubx/core/metrics.py +5 -0
- qubx/core/series.cpython-311-x86_64-linux-gnu.so +0 -0
- qubx/core/utils.cpython-311-x86_64-linux-gnu.so +0 -0
- qubx/ta/indicators.cpython-311-x86_64-linux-gnu.so +0 -0
- qubx/utils/charting/lookinglass.py +41 -53
- {qubx-0.2.62.dist-info → qubx-0.2.64.dist-info}/METADATA +1 -1
- {qubx-0.2.62.dist-info → qubx-0.2.64.dist-info}/RECORD +9 -9
- {qubx-0.2.62.dist-info → qubx-0.2.64.dist-info}/WHEEL +0 -0
qubx/core/basics.py
CHANGED
qubx/core/metrics.py
CHANGED
|
@@ -892,6 +892,7 @@ def chart_signals(
|
|
|
892
892
|
overlay=[],
|
|
893
893
|
info=True,
|
|
894
894
|
show_trades: bool = True,
|
|
895
|
+
show_signals: bool = False,
|
|
895
896
|
show_quantity: bool = False,
|
|
896
897
|
show_value: bool = False,
|
|
897
898
|
show_leverage: bool = True,
|
|
@@ -965,6 +966,10 @@ def chart_signals(
|
|
|
965
966
|
]
|
|
966
967
|
overlay = list(overlay) + [excs]
|
|
967
968
|
|
|
969
|
+
if show_signals:
|
|
970
|
+
sigs = result.signals_log[result.signals_log["instrument_id"] == symbol]
|
|
971
|
+
overlay = list(overlay) + [sigs]
|
|
972
|
+
|
|
968
973
|
chart = LookingGlass([bars, *overlay], indicators).look(start, end, title=symbol).hover(show_info=info, h=height)
|
|
969
974
|
if not show_table:
|
|
970
975
|
return chart.show()
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -544,6 +544,23 @@ class LookingGlassPlotly(AbstractLookingGlass):
|
|
|
544
544
|
def __plt_series(self, y, zoom, study_name, k, row, col, plot_style="line"):
|
|
545
545
|
_lbl = y.name if hasattr(y, "name") and y.name else ("%s_%d" % (study_name, k))
|
|
546
546
|
|
|
547
|
+
def _scatter(
|
|
548
|
+
xs: pd.Series, comments: pd.Series | None, name: str, marker: str, color: str, size: int = 11
|
|
549
|
+
) -> None:
|
|
550
|
+
_args = dict(
|
|
551
|
+
x=xs.index,
|
|
552
|
+
y=xs,
|
|
553
|
+
mode="markers",
|
|
554
|
+
name=name,
|
|
555
|
+
text=comments,
|
|
556
|
+
marker={
|
|
557
|
+
"symbol": marker,
|
|
558
|
+
"size": size,
|
|
559
|
+
"color": color,
|
|
560
|
+
},
|
|
561
|
+
)
|
|
562
|
+
self.fig.add_trace(go.Scatter(**_args), row=row, col=col)
|
|
563
|
+
|
|
547
564
|
if isinstance(y, pd.DataFrame):
|
|
548
565
|
yy = y[zoom] if zoom else y
|
|
549
566
|
|
|
@@ -760,65 +777,36 @@ class LookingGlassPlotly(AbstractLookingGlass):
|
|
|
760
777
|
elif self._frame_has_cols(y, ["Type", "Time", "Price", "PriceOccured"]):
|
|
761
778
|
_bot = yy[yy.Type == "-"]
|
|
762
779
|
_top = yy[yy.Type == "+"]
|
|
763
|
-
self.fig.add_trace(
|
|
764
|
-
go.Scatter(
|
|
765
|
-
x=_bot.index,
|
|
766
|
-
y=_bot.PriceOccured,
|
|
767
|
-
mode="markers",
|
|
768
|
-
name="B",
|
|
769
|
-
marker={"symbol": "triangle-right"},
|
|
770
|
-
),
|
|
771
|
-
row=row,
|
|
772
|
-
col=col,
|
|
773
|
-
)
|
|
774
780
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
x=_top.index,
|
|
778
|
-
y=_top.PriceOccured,
|
|
779
|
-
mode="markers",
|
|
780
|
-
name="T",
|
|
781
|
-
marker={"symbol": "triangle-right"},
|
|
782
|
-
),
|
|
783
|
-
row=row,
|
|
784
|
-
col=col,
|
|
785
|
-
)
|
|
781
|
+
_scatter(_bot.PriceOccured, None, "B", "triangle-right", "#3cfa00", 12)
|
|
782
|
+
_scatter(_top.PriceOccured, None, "T", "triangle-right", "#3cfa00", 12)
|
|
786
783
|
|
|
787
|
-
#
|
|
784
|
+
# executions from executor's log
|
|
788
785
|
elif self._frame_has_cols(y, ["exec_price", "quantity"]):
|
|
789
786
|
_b_ords = yy[yy.quantity > 0]
|
|
790
787
|
_s_ords = yy[yy.quantity < 0]
|
|
791
|
-
self.fig.add_trace(
|
|
792
|
-
go.Scatter(
|
|
793
|
-
x=_b_ords.index,
|
|
794
|
-
y=_b_ords.exec_price,
|
|
795
|
-
mode="markers",
|
|
796
|
-
name="BOT",
|
|
797
|
-
marker={
|
|
798
|
-
"symbol": "triangle-up",
|
|
799
|
-
"size": 13,
|
|
800
|
-
"color": "#3cfa00",
|
|
801
|
-
},
|
|
802
|
-
),
|
|
803
|
-
row=row,
|
|
804
|
-
col=col,
|
|
805
|
-
)
|
|
806
788
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
789
|
+
_scatter(_b_ords.exec_price, None, "BOT", "triangle-up", "#3cfa00", 12)
|
|
790
|
+
_scatter(_s_ords.exec_price, None, "SLD", "triangle-down", "#20ffff", 12)
|
|
791
|
+
|
|
792
|
+
# 27-aug-2024: show generated signals from Qubx backtester
|
|
793
|
+
elif self._frame_has_cols(y, ["signal", "reference_price", "price", "take", "stop", "group", "comment"]):
|
|
794
|
+
_sel_price = lambda x: x["reference_price"].where(x["price"].isna(), x["price"])
|
|
795
|
+
_b_sigs = yy[yy.signal > 0]
|
|
796
|
+
_z_sigs = yy[yy.signal == 0]
|
|
797
|
+
_s_sigs = yy[yy.signal < 0]
|
|
798
|
+
# - Longs
|
|
799
|
+
_scatter(_sel_price(_b_sigs), _b_sigs["comment"], "LONG", "triangle-up-open-dot", "#3cfa00")
|
|
800
|
+
_scatter(_b_sigs[~_b_sigs["take"].isna()]["take"], None, "Take", "line-ew-open", "#3cfa00")
|
|
801
|
+
_scatter(_b_sigs[~_b_sigs["stop"].isna()]["stop"], None, "Stop", "line-ew-open", "#fa3c00")
|
|
802
|
+
|
|
803
|
+
# - Shorts
|
|
804
|
+
_scatter(_sel_price(_s_sigs), _s_sigs["comment"], "SHORTS", "triangle-down-open-dot", "#20ffff")
|
|
805
|
+
_scatter(_s_sigs[~_s_sigs["take"].isna()]["take"], None, "Take", "line-ew-open", "#3cfa00")
|
|
806
|
+
_scatter(_s_sigs[~_s_sigs["stop"].isna()]["stop"], None, "Stop", "line-ew-open", "#fa3c00")
|
|
807
|
+
|
|
808
|
+
# - Exits
|
|
809
|
+
_scatter(_sel_price(_z_sigs), _z_sigs["comment"], "EXITS", "circle-open-dot", "#ffffff")
|
|
822
810
|
|
|
823
811
|
else:
|
|
824
812
|
for _col in yy.columns:
|
|
@@ -7,19 +7,19 @@ qubx/backtester/queue.py,sha256=ys9tHyrqx3NKbcoTAoOn0m0caIk5F0GpS2x7_sCikro,1499
|
|
|
7
7
|
qubx/backtester/simulator.py,sha256=8FRbXo_5WtjOZy0WLQ9wBwVBcm76wTJTidnZKv-i2PI,34105
|
|
8
8
|
qubx/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
qubx/core/account.py,sha256=uIU-EUMuH5owWhHTmU1pZ0WrkQkiv9YiFqSZW9dFDK8,9066
|
|
10
|
-
qubx/core/basics.py,sha256=
|
|
10
|
+
qubx/core/basics.py,sha256=3ew95yUchkZIZFxcNbPhdW5S9-djaSwdk0VLPdQupn4,20873
|
|
11
11
|
qubx/core/context.py,sha256=8Lv0MCe9vKCGL8pFWJCFep6BGm1YT83oOAkW0ssomaQ,37572
|
|
12
12
|
qubx/core/exceptions.py,sha256=W1gG_0fE3o2EMGUfOeOl3vVJDp8Z1iHLv4iZ0ThNkTs,306
|
|
13
13
|
qubx/core/helpers.py,sha256=JAB1kcKO8l--gxg9_W2BzWW1N4x72sicw1oBszKYcbo,12657
|
|
14
14
|
qubx/core/loggers.py,sha256=6P3NwoyHe_pTW8Kdvmi8eHoCxHAWm7LEvwgmX-vZKR4,16530
|
|
15
15
|
qubx/core/lookups.py,sha256=qGOSb2SIxmgVPGJFLJnPDI1P9hCzFMVipRDcVLUm8qk,14599
|
|
16
|
-
qubx/core/metrics.py,sha256=
|
|
17
|
-
qubx/core/series.cpython-311-x86_64-linux-gnu.so,sha256=
|
|
16
|
+
qubx/core/metrics.py,sha256=0PKXaG9hjoHAjAgrEqI9O1RAQshav5LSUIOewx3DX1A,36713
|
|
17
|
+
qubx/core/series.cpython-311-x86_64-linux-gnu.so,sha256=wNnq-w1OGvdxwydX5wPZ8b4KUe7AR1G2lVXJZPIugvE,762408
|
|
18
18
|
qubx/core/series.pxd,sha256=1KJGzun_R5GDDOynPbZER7Xg45a0JUM_S_lZ-9FFFJg,2994
|
|
19
19
|
qubx/core/series.pyi,sha256=ipca4P8LJGDvkhAAczLoZbgLvcJSm-5SFKlaQI9cn9E,2254
|
|
20
20
|
qubx/core/series.pyx,sha256=7R0SQ3OKfxqdxlbBXAG1ld3WS-vrMT9us1Tvq21GLFY,31116
|
|
21
21
|
qubx/core/strategy.py,sha256=RY2fdg7lvLquTxfUamewO51yaRVTElJLmariTB4e3CQ,10901
|
|
22
|
-
qubx/core/utils.cpython-311-x86_64-linux-gnu.so,sha256=
|
|
22
|
+
qubx/core/utils.cpython-311-x86_64-linux-gnu.so,sha256=DZnZmsfZ11OXsi86SSNzp7l5M0RtHatqf1M1qSoWaS0,82504
|
|
23
23
|
qubx/core/utils.pyi,sha256=DAjyRVPJSxK4Em-9wui2F0yYHfP5tI5DjKavXNOnHa8,276
|
|
24
24
|
qubx/core/utils.pyx,sha256=gWLTJzFvvqYlVjSbGccAizdkLinAUEVUcfF-eKWpCHo,1660
|
|
25
25
|
qubx/data/helpers.py,sha256=A0NGzhpXYWD92-GeB8TghwMnR0NW8bjcNJOCXybQw3g,782
|
|
@@ -35,7 +35,7 @@ qubx/pandaz/__init__.py,sha256=Iw5uzicYGSC3FEKZ-W1O5-7cXq_P0kH11-EcXV0zZhs,175
|
|
|
35
35
|
qubx/pandaz/ta.py,sha256=NthiiueUoqWGRcjovcKKThcCcdImZn3JRdWDA2vL28k,85075
|
|
36
36
|
qubx/pandaz/utils.py,sha256=XB28Zwv3cXWbKFXbcV5QGj_d6w-i8Yo4LYkX8aPuCHo,19613
|
|
37
37
|
qubx/ta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
-
qubx/ta/indicators.cpython-311-x86_64-linux-gnu.so,sha256=
|
|
38
|
+
qubx/ta/indicators.cpython-311-x86_64-linux-gnu.so,sha256=Ll6Je0gMYYxKCZerSiRKi_O2VZUQScAykrLW9SBrdhY,555560
|
|
39
39
|
qubx/ta/indicators.pxd,sha256=N1XyVos-5IsMF4A0_nmaSRlocHnui5bFJGwJCSTkwd4,3898
|
|
40
40
|
qubx/ta/indicators.pyi,sha256=2OL0BIKNCPQfe61TEI_nu4qgFYSjGc9ERGDoQlojWo8,1334
|
|
41
41
|
qubx/ta/indicators.pyx,sha256=HW0NZb7DTY6_6eSrkvOOp7hg2ZATM0L_GZwm4VnKRJo,22647
|
|
@@ -46,13 +46,13 @@ qubx/trackers/riskctrl.py,sha256=8P5iyaJ-PKhIX8GkGBpncQdxnefL1QWRWG-Jx1PFTuk,125
|
|
|
46
46
|
qubx/trackers/sizers.py,sha256=Wkpclaw7mfR_eMc9xMjN2AFgvOpY1jzaz3wDQvs9H0U,5988
|
|
47
47
|
qubx/utils/__init__.py,sha256=AL2YibJ3tqBKsZZLUjM9N2J5yy-Kq__k_44oTODQ5sM,321
|
|
48
48
|
qubx/utils/_pyxreloader.py,sha256=FyqGzfSpZGYziB8JYS5AP3cLRAvJSIPAKgwQn0E4YQ0,12017
|
|
49
|
-
qubx/utils/charting/lookinglass.py,sha256=
|
|
49
|
+
qubx/utils/charting/lookinglass.py,sha256=V9EiNXBdeL39ru_M6hPyHTOzFHoZsXiFPLjG4rWjkFk,38826
|
|
50
50
|
qubx/utils/charting/mpl_helpers.py,sha256=z6vL0IllTZeD-Oe-alVW-kYOP_deHyyoFcukvOVwSz8,35354
|
|
51
51
|
qubx/utils/marketdata/binance.py,sha256=36dl4rxOAGTeY3uoONmiPanj8BkP0oBdDiH-URJJo9A,10993
|
|
52
52
|
qubx/utils/misc.py,sha256=Av0mhrPCy5NZRrRmjOAhTKusa8wVdL7vCQtEy9bVnz4,10450
|
|
53
53
|
qubx/utils/ntp.py,sha256=LZo4FPVY3rqLUV9VWkLcZaPOpUDFC8Qleynmfggg9No,1758
|
|
54
54
|
qubx/utils/runner.py,sha256=Czo01KUCc9Oj9TIcs03d6Qh7fOpQV5w8oH6UDZ6Yqn0,9539
|
|
55
55
|
qubx/utils/time.py,sha256=ioIos3VLA-iYI8LiQIn2m-t0Y37CEQAHFw_-C9Uwo0o,5188
|
|
56
|
-
qubx-0.2.
|
|
57
|
-
qubx-0.2.
|
|
58
|
-
qubx-0.2.
|
|
56
|
+
qubx-0.2.64.dist-info/METADATA,sha256=9EPXQJcE04ZWj_spVTcJ4GsSmWe8Zul0Y6wxKC7Hlnw,2573
|
|
57
|
+
qubx-0.2.64.dist-info/WHEEL,sha256=MLOa6LysROdjgj4FVxsHitAnIh8Be2D_c9ZSBHKrz2M,110
|
|
58
|
+
qubx-0.2.64.dist-info/RECORD,,
|
|
File without changes
|