investing-algorithm-framework 7.16.1__py3-none-any.whl → 7.16.3__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/backtesting/backtest_service.py +1 -1
- investing_algorithm_framework/services/metrics/generate.py +2 -2
- investing_algorithm_framework/services/metrics/trades.py +4 -4
- {investing_algorithm_framework-7.16.1.dist-info → investing_algorithm_framework-7.16.3.dist-info}/METADATA +1 -1
- {investing_algorithm_framework-7.16.1.dist-info → investing_algorithm_framework-7.16.3.dist-info}/RECORD +8 -8
- {investing_algorithm_framework-7.16.1.dist-info → investing_algorithm_framework-7.16.3.dist-info}/LICENSE +0 -0
- {investing_algorithm_framework-7.16.1.dist-info → investing_algorithm_framework-7.16.3.dist-info}/WHEEL +0 -0
- {investing_algorithm_framework-7.16.1.dist-info → investing_algorithm_framework-7.16.3.dist-info}/entry_points.txt +0 -0
|
@@ -375,9 +375,9 @@ class BacktestService:
|
|
|
375
375
|
ohlcv = granular_ohlcv_data_order_by_symbol[
|
|
376
376
|
f"{open_trade.target_symbol}/{trading_symbol}"
|
|
377
377
|
]
|
|
378
|
-
|
|
379
378
|
try:
|
|
380
379
|
price = ohlcv.loc[:ts, "Close"].iloc[-1]
|
|
380
|
+
open_trade.last_reported_price = price
|
|
381
381
|
except IndexError:
|
|
382
382
|
continue # skip if no price yet
|
|
383
383
|
|
|
@@ -298,9 +298,9 @@ def create_backtest_metrics(
|
|
|
298
298
|
safe_set("best_trade", get_best_trade, backtest_run.trades)
|
|
299
299
|
safe_set("worst_trade", get_worst_trade, backtest_run.trades)
|
|
300
300
|
safe_set("win_rate", get_win_rate, backtest_run.trades)
|
|
301
|
-
safe_set("current_win_rate", get_current_win_rate, backtest_run.trades
|
|
301
|
+
safe_set("current_win_rate", get_current_win_rate, backtest_run.trades)
|
|
302
302
|
safe_set("win_loss_ratio", get_win_loss_ratio, backtest_run.trades)
|
|
303
|
-
safe_set("current_win_loss_ratio", get_current_win_loss_ratio, backtest_run.trades
|
|
303
|
+
safe_set("current_win_loss_ratio", get_current_win_loss_ratio, backtest_run.trades)
|
|
304
304
|
safe_set("percentage_winning_months", get_percentage_winning_months, backtest_run.portfolio_snapshots)
|
|
305
305
|
safe_set("percentage_winning_years", get_percentage_winning_years, backtest_run.portfolio_snapshots)
|
|
306
306
|
safe_set("average_monthly_return", get_average_monthly_return, backtest_run.portfolio_snapshots)
|
|
@@ -245,7 +245,7 @@ def get_average_trade_return(trades: List[Trade]) -> Tuple[float, float]:
|
|
|
245
245
|
average_return = total_return / len(closed_trades)
|
|
246
246
|
|
|
247
247
|
percentage_returns = [
|
|
248
|
-
(t.net_gain / t.cost)
|
|
248
|
+
(t.net_gain / t.cost) for t in closed_trades if t.cost > 0
|
|
249
249
|
]
|
|
250
250
|
average_return_percentage = (
|
|
251
251
|
sum(percentage_returns) / len(percentage_returns)
|
|
@@ -278,7 +278,7 @@ def get_current_average_trade_return(
|
|
|
278
278
|
average_return = total_return / len(trades)
|
|
279
279
|
|
|
280
280
|
percentage_returns = [
|
|
281
|
-
(t.net_gain / t.cost)
|
|
281
|
+
(t.net_gain / t.cost) for t in trades if t.cost > 0
|
|
282
282
|
]
|
|
283
283
|
average_return_percentage = (
|
|
284
284
|
sum(percentage_returns) / len(percentage_returns)
|
|
@@ -374,7 +374,7 @@ def get_average_trade_loss(trades: List[Trade]) -> Tuple[float, float]:
|
|
|
374
374
|
losses = [t.net_gain for t in losing_trades]
|
|
375
375
|
average_loss = sum(losses) / len(losses)
|
|
376
376
|
percentage_returns = [
|
|
377
|
-
(t.net_gain / t.cost)
|
|
377
|
+
(t.net_gain / t.cost) for t in losing_trades if t.cost > 0
|
|
378
378
|
]
|
|
379
379
|
average_return_percentage = (
|
|
380
380
|
sum(percentage_returns) / len(percentage_returns)
|
|
@@ -412,7 +412,7 @@ def get_current_average_trade_loss(
|
|
|
412
412
|
losses = [t.net_gain for t in losing_trades]
|
|
413
413
|
average_loss = sum(losses) / len(losses)
|
|
414
414
|
percentage_returns = [
|
|
415
|
-
(t.net_gain / t.cost)
|
|
415
|
+
(t.net_gain / t.cost) for t in losing_trades if t.cost > 0
|
|
416
416
|
]
|
|
417
417
|
average_return_percentage = (
|
|
418
418
|
sum(percentage_returns) / len(percentage_returns)
|
|
@@ -202,7 +202,7 @@ investing_algorithm_framework/infrastructure/services/azure/__init__.py,sha256=P
|
|
|
202
202
|
investing_algorithm_framework/infrastructure/services/azure/state_handler.py,sha256=EUk4PdVl6RQ19DuWdrC4DzgOhGcL3qiZKWgWh_obT4E,5240
|
|
203
203
|
investing_algorithm_framework/services/__init__.py,sha256=9p0Y2enp6UMOlU4qJgVoojHBRARLGefNzbPxgSCN0wI,4999
|
|
204
204
|
investing_algorithm_framework/services/backtesting/__init__.py,sha256=sD6JMQVuUT8NRKV77VC9jyGnHcGox0W2n9eA-4ydeHY,84
|
|
205
|
-
investing_algorithm_framework/services/backtesting/backtest_service.py,sha256=
|
|
205
|
+
investing_algorithm_framework/services/backtesting/backtest_service.py,sha256=wT2FqRCnv9HUREvTV6b9sHAZRlJ3go3FtAqfwHTwxB8,23427
|
|
206
206
|
investing_algorithm_framework/services/configuration_service.py,sha256=BCgiBlrLjMjfU4afmjYaHu9gOWNmgaxhf6RBN2XJkw0,2853
|
|
207
207
|
investing_algorithm_framework/services/data_providers/__init__.py,sha256=OHVccpIYGc-1B2AkCI_2Nhsb9KMaAUrng4DHhIbFD8Y,96
|
|
208
208
|
investing_algorithm_framework/services/data_providers/data_provider_service.py,sha256=Tv5W38rshK7sG7XEhp7L-McdiNWAAlvU_1ScSdt1NCE,28420
|
|
@@ -215,7 +215,7 @@ investing_algorithm_framework/services/metrics/calmar_ratio.py,sha256=clZTkG6bjZ
|
|
|
215
215
|
investing_algorithm_framework/services/metrics/drawdown.py,sha256=VWkPXOm9CSdq6LHL6Pa9JnDObsu-1OOqgC4XRZqZO3Q,6193
|
|
216
216
|
investing_algorithm_framework/services/metrics/equity_curve.py,sha256=Z3YdqEJ7x9N-RKOC4bt-1LuiKAYTCxhuE6Fx1lJyAS0,702
|
|
217
217
|
investing_algorithm_framework/services/metrics/exposure.py,sha256=kQPreO5RR72DgTRdSdMPiG6onZTAWvyYTrp3hsI6vYw,6234
|
|
218
|
-
investing_algorithm_framework/services/metrics/generate.py,sha256=
|
|
218
|
+
investing_algorithm_framework/services/metrics/generate.py,sha256=vpWxspLSjdf450horKxHPWi2Xh4jxtS940HAxgCCGv8,15931
|
|
219
219
|
investing_algorithm_framework/services/metrics/mean_daily_return.py,sha256=_e5GCD5xppa_GrYMEeQB9or1WLkJIF-mdmDfes8CRjQ,2384
|
|
220
220
|
investing_algorithm_framework/services/metrics/price_efficiency.py,sha256=hpt1Nyk7s_jxFeqEVeQV9FH5N4RzJx6SP072L4z9fYw,1844
|
|
221
221
|
investing_algorithm_framework/services/metrics/profit_factor.py,sha256=6OMC2yx1stMrJKaVSCMWyVbVMgfurYTiue7P7QeCEHs,5178
|
|
@@ -225,7 +225,7 @@ investing_algorithm_framework/services/metrics/risk_free_rate.py,sha256=bATheWxy
|
|
|
225
225
|
investing_algorithm_framework/services/metrics/sharpe_ratio.py,sha256=XDEiTUBoK-qpoeqmbhrcy1v-AuNagWhTWx_Myn0g8-A,5497
|
|
226
226
|
investing_algorithm_framework/services/metrics/sortino_ratio.py,sha256=WA8uTkyk8RMG6uMplCvV8okAlKG_aeTP4ZAX2VyNkpA,2993
|
|
227
227
|
investing_algorithm_framework/services/metrics/standard_deviation.py,sha256=oObshTljORuE3x1cS0wej8QCqmDzAwHQgOA5u_HdfbU,4533
|
|
228
|
-
investing_algorithm_framework/services/metrics/trades.py,sha256=
|
|
228
|
+
investing_algorithm_framework/services/metrics/trades.py,sha256=TOczZW4pZYf2WF4ccp6ufFnlSFxXdtbeo7pzLvy0qU8,13461
|
|
229
229
|
investing_algorithm_framework/services/metrics/treynor_ratio.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
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
|
|
@@ -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.3.dist-info/LICENSE,sha256=wbVEDvoZiMPHufRY3sLEffvAr7GH5hOIngHF8y4HFQg,11343
|
|
256
|
+
investing_algorithm_framework-7.16.3.dist-info/METADATA,sha256=RKh3AaFX3QaIN6A6tIvFdygbstwgtAnsalPapACERvA,19635
|
|
257
|
+
investing_algorithm_framework-7.16.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
258
|
+
investing_algorithm_framework-7.16.3.dist-info/entry_points.txt,sha256=jrPF0YksDs27vYzEvj3tXLe3OGWU24EJA05z5xHqmq8,91
|
|
259
|
+
investing_algorithm_framework-7.16.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|