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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: quantex
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: A simple quant strategy creation and backtesting package.
5
5
  License: MIT
6
6
  Author: Daniel Green
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "quantex"
3
- version = "0.4.3"
3
+ version = "0.4.4"
4
4
  description = "A simple quant strategy creation and backtesting package."
5
5
  authors = [
6
6
  {name = "Daniel Green",email = "dangreen07@outlook.com"}
@@ -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.where(np.arange(len(equity_values)) == 0, original_cash, equity_values[:-1])
344
- equity_returns[1:] = np.where(prev > 0, (equity_values[1:] / prev) - 1.0, 0.0)
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