quantex 0.4.3__tar.gz → 0.4.4__tar.gz
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.
- {quantex-0.4.3 → quantex-0.4.4}/PKG-INFO +1 -1
- {quantex-0.4.3 → quantex-0.4.4}/pyproject.toml +1 -1
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/backtester/montecarlo.py +4 -2
- {quantex-0.4.3 → quantex-0.4.4}/LICENSE.md +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/README.md +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/__init__.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/backtester/__init__.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/backtester/backtester.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/backtester/constants.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/backtester/data_splits.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/backtester/metrics.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/backtester/parallel.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/backtester/reports.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/broker/__init__.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/broker/broker.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/broker/types.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/datasource.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/helpers.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/indicators.py +0 -0
- {quantex-0.4.3 → quantex-0.4.4}/src/quantex/strategy.py +0 -0
|
@@ -340,8 +340,10 @@ def _run_trade_order_simulation(
|
|
|
340
340
|
equity_values = np.asarray(original_equity.values, dtype=np.float64)
|
|
341
341
|
equity_returns = np.zeros_like(equity_values)
|
|
342
342
|
if len(equity_values) > 1:
|
|
343
|
-
prev = np.
|
|
344
|
-
|
|
343
|
+
prev = np.empty_like(equity_values)
|
|
344
|
+
prev[0] = original_cash
|
|
345
|
+
prev[1:] = equity_values[:-1]
|
|
346
|
+
equity_returns[1:] = np.where(prev[1:] > 0, (equity_values[1:] / prev[1:]) - 1.0, 0.0)
|
|
345
347
|
|
|
346
348
|
# Keep the starting cash anchored at index 0 and randomize the remaining
|
|
347
349
|
# returns so the path always begins from the actual initial capital.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|