investing-algorithm-framework 7.16.18__py3-none-any.whl → 7.16.20__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/domain/backtesting/backtest_metrics.py +8 -0
- investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py +6 -0
- investing_algorithm_framework/domain/backtesting/combine_backtests.py +10 -0
- {investing_algorithm_framework-7.16.18.dist-info → investing_algorithm_framework-7.16.20.dist-info}/METADATA +1 -1
- {investing_algorithm_framework-7.16.18.dist-info → investing_algorithm_framework-7.16.20.dist-info}/RECORD +8 -8
- {investing_algorithm_framework-7.16.18.dist-info → investing_algorithm_framework-7.16.20.dist-info}/LICENSE +0 -0
- {investing_algorithm_framework-7.16.18.dist-info → investing_algorithm_framework-7.16.20.dist-info}/WHEEL +0 -0
- {investing_algorithm_framework-7.16.18.dist-info → investing_algorithm_framework-7.16.20.dist-info}/entry_points.txt +0 -0
|
@@ -104,8 +104,12 @@ class BacktestMetrics:
|
|
|
104
104
|
still open at the end of the backtest.
|
|
105
105
|
win_rate (float): The win rate of the trades, expressed
|
|
106
106
|
as a percentage.
|
|
107
|
+
current_win_rate (float): The current win rate of the trades,
|
|
108
|
+
including open trades.
|
|
107
109
|
win_loss_ratio (float): The ratio of winning trades
|
|
108
110
|
to losing trades.
|
|
111
|
+
current_win_loss_ratio (float): The current ratio of winning
|
|
112
|
+
trades to losing trades, including open trades.
|
|
109
113
|
percentage_winning_months (float): The percentage of months
|
|
110
114
|
with positive returns.
|
|
111
115
|
percentage_winning_years (float): The percentage of years with
|
|
@@ -193,7 +197,9 @@ class BacktestMetrics:
|
|
|
193
197
|
number_of_trades_opened: int = 0
|
|
194
198
|
number_of_trades_open_at_end: int = 0
|
|
195
199
|
win_rate: float = 0.0
|
|
200
|
+
current_win_rate: float = 0.0
|
|
196
201
|
win_loss_ratio: float = 0.0
|
|
202
|
+
current_win_loss_ratio: float = 0.0
|
|
197
203
|
percentage_winning_months: float = 0.0
|
|
198
204
|
percentage_winning_years: float = 0.0
|
|
199
205
|
average_monthly_return: float = 0.0
|
|
@@ -289,7 +295,9 @@ class BacktestMetrics:
|
|
|
289
295
|
"number_of_trades_closed": self.number_of_trades_closed,
|
|
290
296
|
"number_of_trades_opened": self.number_of_trades_opened,
|
|
291
297
|
"win_rate": self.win_rate,
|
|
298
|
+
"current_win_rate": self.current_win_rate,
|
|
292
299
|
"win_loss_ratio": self.win_loss_ratio,
|
|
300
|
+
"current_win_loss_ratio": self.current_win_loss_ratio,
|
|
293
301
|
"percentage_winning_months": self.percentage_winning_months,
|
|
294
302
|
"percentage_winning_years": self.percentage_winning_years,
|
|
295
303
|
"average_monthly_return": self.average_monthly_return,
|
|
@@ -48,7 +48,9 @@ class BacktestSummaryMetrics:
|
|
|
48
48
|
max_drawdown_duration (int): Duration of the maximum drawdown.
|
|
49
49
|
trades_per_year (float): Average trades executed per year.
|
|
50
50
|
win_rate (float): Percentage of winning trades.
|
|
51
|
+
current_win_rate (float): Win rate over recent trades.
|
|
51
52
|
win_loss_ratio (float): Ratio of average win to average loss.
|
|
53
|
+
current_win_loss_ratio (float): Win/loss ratio over recent trades.
|
|
52
54
|
number_of_trades (int): Total number of trades executed.
|
|
53
55
|
cumulative_exposure (float): Total exposure over the backtest period.
|
|
54
56
|
exposure_ratio (float): Ratio of exposure to available capital.
|
|
@@ -81,7 +83,9 @@ class BacktestSummaryMetrics:
|
|
|
81
83
|
max_drawdown_duration: int = None
|
|
82
84
|
trades_per_year: float = None
|
|
83
85
|
win_rate: float = None
|
|
86
|
+
current_win_rate: float = None
|
|
84
87
|
win_loss_ratio: float = None
|
|
88
|
+
current_win_loss_ratio: float = None
|
|
85
89
|
number_of_trades: int = None
|
|
86
90
|
number_of_trades_closed: int = None
|
|
87
91
|
cumulative_exposure: float = None
|
|
@@ -123,7 +127,9 @@ class BacktestSummaryMetrics:
|
|
|
123
127
|
"max_drawdown_duration": self.max_drawdown_duration,
|
|
124
128
|
"trades_per_year": self.trades_per_year,
|
|
125
129
|
"win_rate": self.win_rate,
|
|
130
|
+
"current_win_rate": self.current_win_rate,
|
|
126
131
|
"win_loss_ratio": self.win_loss_ratio,
|
|
132
|
+
"current_win_loss_ratio": self.current_win_loss_ratio,
|
|
127
133
|
"number_of_trades": self.number_of_trades,
|
|
128
134
|
"number_of_trades_closed": self.number_of_trades_closed,
|
|
129
135
|
"cumulative_exposure": self.cumulative_exposure,
|
|
@@ -184,10 +184,18 @@ def generate_backtest_summary_metrics(
|
|
|
184
184
|
[b.win_rate for b in backtest_metrics],
|
|
185
185
|
[b.total_number_of_days for b in backtest_metrics]
|
|
186
186
|
)
|
|
187
|
+
current_win_rate = safe_weighted_mean(
|
|
188
|
+
[b.current_win_rate for b in backtest_metrics],
|
|
189
|
+
[b.total_number_of_days for b in backtest_metrics]
|
|
190
|
+
)
|
|
187
191
|
win_loss_ratio = safe_weighted_mean(
|
|
188
192
|
[b.win_loss_ratio for b in backtest_metrics],
|
|
189
193
|
[b.total_number_of_days for b in backtest_metrics]
|
|
190
194
|
)
|
|
195
|
+
current_win_loss_ratio = safe_weighted_mean(
|
|
196
|
+
[b.current_win_loss_ratio for b in backtest_metrics],
|
|
197
|
+
[b.total_number_of_days for b in backtest_metrics]
|
|
198
|
+
)
|
|
191
199
|
number_of_trades = sum(
|
|
192
200
|
b.number_of_trades for b in backtest_metrics
|
|
193
201
|
if b.number_of_trades is not None
|
|
@@ -251,7 +259,9 @@ def generate_backtest_summary_metrics(
|
|
|
251
259
|
max_drawdown_duration=max_drawdown_duration,
|
|
252
260
|
trades_per_year=trades_per_year,
|
|
253
261
|
win_rate=win_rate,
|
|
262
|
+
current_win_rate=current_win_rate,
|
|
254
263
|
win_loss_ratio=win_loss_ratio,
|
|
264
|
+
current_win_loss_ratio=current_win_loss_ratio,
|
|
255
265
|
number_of_trades=number_of_trades,
|
|
256
266
|
number_of_trades_closed=number_of_trades_closed,
|
|
257
267
|
cumulative_exposure=cumulative_exposure,
|
|
@@ -87,11 +87,11 @@ investing_algorithm_framework/domain/backtesting/__init__.py,sha256=q-NejGHzE233
|
|
|
87
87
|
investing_algorithm_framework/domain/backtesting/backtest.py,sha256=mS7JdPTXhw5AQrQ-krXWtpNsBbVVYkxc1lBSoPhCqoQ,15617
|
|
88
88
|
investing_algorithm_framework/domain/backtesting/backtest_date_range.py,sha256=e_V7HMdtln4uu87jwwa_Yr7ZesgrpFqsEqtr0e0DTto,3186
|
|
89
89
|
investing_algorithm_framework/domain/backtesting/backtest_evaluation_focuss.py,sha256=D__3I_TSxDVnGtlddmWt4wHcqut8MGyYMf1IfQZXYJ0,7547
|
|
90
|
-
investing_algorithm_framework/domain/backtesting/backtest_metrics.py,sha256=
|
|
90
|
+
investing_algorithm_framework/domain/backtesting/backtest_metrics.py,sha256=gfiuNhT15UpY5l02onknf7D5wHJfeUKodlnG9FV5I1E,20120
|
|
91
91
|
investing_algorithm_framework/domain/backtesting/backtest_permutation_test.py,sha256=8JXdu3EgFh2f2Yc41OYwIBwlYtjFiumyAJUrN5kL078,6703
|
|
92
92
|
investing_algorithm_framework/domain/backtesting/backtest_run.py,sha256=ffQgilEkyixGrGvKeCZF670OPoY3ljixlgsXPajHpZY,14310
|
|
93
|
-
investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py,sha256=
|
|
94
|
-
investing_algorithm_framework/domain/backtesting/combine_backtests.py,sha256=
|
|
93
|
+
investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py,sha256=Dt3gFz-MNmxtOhYxVPN8lI_7rXtE9PK10lULDFuCHlU,7131
|
|
94
|
+
investing_algorithm_framework/domain/backtesting/combine_backtests.py,sha256=O2tv59Ak9Jy25w47Iz2b2pdtr2uDmkb8OUeoEMihq2o,9993
|
|
95
95
|
investing_algorithm_framework/domain/config.py,sha256=_VkaJvrdqIKAT3_l-Y8XTEKNEaw5uVIwQ7vxomuCpUw,3003
|
|
96
96
|
investing_algorithm_framework/domain/constants.py,sha256=-ZU0z1DSgJaUQvkp_ELZslqD0D-scASz7uhdXRbR8Tc,2610
|
|
97
97
|
investing_algorithm_framework/domain/data_provider.py,sha256=PJPbG6qWbHoGqJskVX8oCB-1FKdf67AZ21eDjcmSNGc,10739
|
|
@@ -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.20.dist-info/LICENSE,sha256=wbVEDvoZiMPHufRY3sLEffvAr7GH5hOIngHF8y4HFQg,11343
|
|
256
|
+
investing_algorithm_framework-7.16.20.dist-info/METADATA,sha256=rliJwEZyg3ys51tNtm4YGRyC9mFHIABzG90ZNDJx0J8,19636
|
|
257
|
+
investing_algorithm_framework-7.16.20.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
258
|
+
investing_algorithm_framework-7.16.20.dist-info/entry_points.txt,sha256=jrPF0YksDs27vYzEvj3tXLe3OGWU24EJA05z5xHqmq8,91
|
|
259
|
+
investing_algorithm_framework-7.16.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|