investing-algorithm-framework 7.16.7__py3-none-any.whl → 7.16.8__py3-none-any.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 investing-algorithm-framework might be problematic. Click here for more details.
- investing_algorithm_framework/services/metrics/win_rate.py +5 -5
- {investing_algorithm_framework-7.16.7.dist-info → investing_algorithm_framework-7.16.8.dist-info}/METADATA +1 -1
- {investing_algorithm_framework-7.16.7.dist-info → investing_algorithm_framework-7.16.8.dist-info}/RECORD +6 -6
- {investing_algorithm_framework-7.16.7.dist-info → investing_algorithm_framework-7.16.8.dist-info}/LICENSE +0 -0
- {investing_algorithm_framework-7.16.7.dist-info → investing_algorithm_framework-7.16.8.dist-info}/WHEEL +0 -0
- {investing_algorithm_framework-7.16.7.dist-info → investing_algorithm_framework-7.16.8.dist-info}/entry_points.txt +0 -0
|
@@ -85,7 +85,7 @@ def get_current_win_rate(trades: List[Trade]) -> float:
|
|
|
85
85
|
if not trades:
|
|
86
86
|
return 0.0
|
|
87
87
|
|
|
88
|
-
positive_trades = sum(1 for trade in trades if trade.
|
|
88
|
+
positive_trades = sum(1 for trade in trades if trade.net_gain_absolute > 0)
|
|
89
89
|
total_trades = len(trades)
|
|
90
90
|
|
|
91
91
|
return positive_trades / total_trades
|
|
@@ -159,16 +159,16 @@ def get_current_win_loss_ratio(trades: List[Trade]) -> float:
|
|
|
159
159
|
return 0.0
|
|
160
160
|
|
|
161
161
|
# Separate winning and losing trades
|
|
162
|
-
winning_trades = [t for t in trades if t.
|
|
163
|
-
losing_trades = [t for t in trades if t.
|
|
162
|
+
winning_trades = [t for t in trades if t.net_gain_absolute > 0]
|
|
163
|
+
losing_trades = [t for t in trades if t.net_gain_absolute < 0]
|
|
164
164
|
|
|
165
165
|
if not winning_trades or not losing_trades:
|
|
166
166
|
return 0.0
|
|
167
167
|
|
|
168
168
|
# Compute averages
|
|
169
|
-
avg_win = sum(t.
|
|
169
|
+
avg_win = sum(t.net_gain_absolute for t in winning_trades) / len(winning_trades)
|
|
170
170
|
avg_loss = abs(
|
|
171
|
-
sum(t.
|
|
171
|
+
sum(t.net_gain_absolute for t in losing_trades) / len(losing_trades))
|
|
172
172
|
|
|
173
173
|
# Avoid division by zero
|
|
174
174
|
if avg_loss == 0:
|
|
@@ -230,7 +230,7 @@ investing_algorithm_framework/services/metrics/treynor_ratio.py,sha256=47DEQpj8H
|
|
|
230
230
|
investing_algorithm_framework/services/metrics/ulcer.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
231
231
|
investing_algorithm_framework/services/metrics/value_at_risk.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
232
232
|
investing_algorithm_framework/services/metrics/volatility.py,sha256=LzeNEkjXrUzzYSWlO8MffJKgFAXY3aaxIH9w4QQKYsc,3275
|
|
233
|
-
investing_algorithm_framework/services/metrics/win_rate.py,sha256=
|
|
233
|
+
investing_algorithm_framework/services/metrics/win_rate.py,sha256=9SXI6E7JS7XQY3qVwARhr-Wti2ZKfd1n3yNXxGL1hIY,5794
|
|
234
234
|
investing_algorithm_framework/services/order_service/__init__.py,sha256=B-9kb7AWnMHCYkT3C7lvUADPWC8uP8cg6ymj3Ngabf0,242
|
|
235
235
|
investing_algorithm_framework/services/order_service/order_backtest_service.py,sha256=20rVRGSX1IRVRrjCgnM3H7gg4MGZdQconJ9tEE_pZzg,6534
|
|
236
236
|
investing_algorithm_framework/services/order_service/order_executor_lookup.py,sha256=QNZr-EiKofPGgYHHBESfxdMXGuLOAT8BlufHx92LkoM,3601
|
|
@@ -252,8 +252,8 @@ investing_algorithm_framework/services/trade_order_evaluator/default_trade_order
|
|
|
252
252
|
investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py,sha256=pNnmgaKMR9RY6Kxq7xS0nURKoaQDe2ehrP5GfElkkcI,1328
|
|
253
253
|
investing_algorithm_framework/services/trade_service/__init__.py,sha256=AcwPyJjDRdiREnl_MWMkDSc-V-ZjXtvpHD6eQT9mc1o,68
|
|
254
254
|
investing_algorithm_framework/services/trade_service/trade_service.py,sha256=OtzIS5EebByGcqDvV2AFeBjXSarvrgubMXDaVKg6Rbw,41193
|
|
255
|
-
investing_algorithm_framework-7.16.
|
|
256
|
-
investing_algorithm_framework-7.16.
|
|
257
|
-
investing_algorithm_framework-7.16.
|
|
258
|
-
investing_algorithm_framework-7.16.
|
|
259
|
-
investing_algorithm_framework-7.16.
|
|
255
|
+
investing_algorithm_framework-7.16.8.dist-info/LICENSE,sha256=wbVEDvoZiMPHufRY3sLEffvAr7GH5hOIngHF8y4HFQg,11343
|
|
256
|
+
investing_algorithm_framework-7.16.8.dist-info/METADATA,sha256=-NZwxEpvpk8FUOtfAsuCK6QpIu1BC8rEP4B-wSPgFaM,19635
|
|
257
|
+
investing_algorithm_framework-7.16.8.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
258
|
+
investing_algorithm_framework-7.16.8.dist-info/entry_points.txt,sha256=jrPF0YksDs27vYzEvj3tXLe3OGWU24EJA05z5xHqmq8,91
|
|
259
|
+
investing_algorithm_framework-7.16.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|