investing-algorithm-framework 7.16.2__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.

@@ -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
 
@@ -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) * 100.0 for t in closed_trades if t.cost > 0
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) * 100.0 for t in trades if t.cost > 0
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) * 100.0 for t in losing_trades if t.cost > 0
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) * 100.0 for t in losing_trades if t.cost > 0
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: investing-algorithm-framework
3
- Version: 7.16.2
3
+ Version: 7.16.3
4
4
  Summary: A framework for creating trading bots
5
5
  Author: MDUYN
6
6
  Requires-Python: >=3.10
@@ -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=xyfTzNlKPLlOsZhPbeTIcUNvdeOUTTGdWKpfdUXFA4A,23369
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
@@ -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=ttCB7Ohb7-yPhfioeuhHjvrrfouXKba6KCsnfjY-uwQ,13493
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.2.dist-info/LICENSE,sha256=wbVEDvoZiMPHufRY3sLEffvAr7GH5hOIngHF8y4HFQg,11343
256
- investing_algorithm_framework-7.16.2.dist-info/METADATA,sha256=b6TVpZAyED9jpV0Kl1O36c3OgDXT1Fiaegyb2cHSMhY,19635
257
- investing_algorithm_framework-7.16.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
258
- investing_algorithm_framework-7.16.2.dist-info/entry_points.txt,sha256=jrPF0YksDs27vYzEvj3tXLe3OGWU24EJA05z5xHqmq8,91
259
- investing_algorithm_framework-7.16.2.dist-info/RECORD,,
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,,