ivolatility-backtesting 2.158__tar.gz → 2.163__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.
Files changed (45) hide show
  1. ivolatility_backtesting-2.163/PKG-INFO +73 -0
  2. ivolatility_backtesting-2.163/README.md +49 -0
  3. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/ivolatility_backtesting/__init__.py +4 -0
  4. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/ivolatility_backtesting/ivolatility_backtesting.py +1405 -316
  5. ivolatility_backtesting-2.163/ivolatility_backtesting.egg-info/PKG-INFO +73 -0
  6. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/ivolatility_backtesting.egg-info/SOURCES.txt +12 -1
  7. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/pyproject.toml +1 -1
  8. ivolatility_backtesting-2.163/tests/test_2159_entry_rule.py +366 -0
  9. ivolatility_backtesting-2.163/tests/test_2160_day_price_order.py +132 -0
  10. ivolatility_backtesting-2.163/tests/test_2160_exit_rule.py +409 -0
  11. ivolatility_backtesting-2.163/tests/test_2160_option_lean_rule.py +228 -0
  12. ivolatility_backtesting-2.163/tests/test_2160_prefetch_cancel.py +132 -0
  13. ivolatility_backtesting-2.163/tests/test_2161_assignment.py +188 -0
  14. ivolatility_backtesting-2.163/tests/test_2162_entry_minute_window.py +70 -0
  15. ivolatility_backtesting-2.163/tests/test_2163_rotation.py +168 -0
  16. ivolatility_backtesting-2.163/tests/test_price_ta_indicators.py +187 -0
  17. ivolatility_backtesting-2.163/tests/test_stock_loader_coverage.py +255 -0
  18. ivolatility_backtesting-2.163/tests/test_vix_percentile_direction.py +63 -0
  19. ivolatility_backtesting-2.158/PKG-INFO +0 -252
  20. ivolatility_backtesting-2.158/README.md +0 -228
  21. ivolatility_backtesting-2.158/ivolatility_backtesting.egg-info/PKG-INFO +0 -252
  22. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/ivolatility_backtesting.egg-info/dependency_links.txt +0 -0
  23. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/ivolatility_backtesting.egg-info/requires.txt +0 -0
  24. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/ivolatility_backtesting.egg-info/top_level.txt +0 -0
  25. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/setup.cfg +0 -0
  26. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2142_fixes.py +0 -0
  27. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2144_duckdb_dedup.py +0 -0
  28. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2146_vix_vro.py +0 -0
  29. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2147_cents_multiplier.py +0 -0
  30. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2148_loader_memory.py +0 -0
  31. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2149_client_errors.py +0 -0
  32. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2150_prompt_patterns.py +0 -0
  33. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2152_cache_lock_and_rate_limit.py +0 -0
  34. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2153_cache_lock_kept.py +0 -0
  35. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2154_put_atm_legs.py +0 -0
  36. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2155_bar_prefetch.py +0 -0
  37. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2155_intraday_exits.py +0 -0
  38. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2155_ivx_stock_holes.py +0 -0
  39. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2155_key_redaction.py +0 -0
  40. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2155_long_expiry.py +0 -0
  41. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2155_opt_stop_merge.py +0 -0
  42. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2156_phantom_quotes.py +0 -0
  43. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2157_sl_symbol.py +0 -0
  44. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2158_default_path_golden.py +0 -0
  45. {ivolatility_backtesting-2.158 → ivolatility_backtesting-2.163}/tests/test_2158_entry_time.py +0 -0
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.4
2
+ Name: ivolatility_backtesting
3
+ Version: 2.163
4
+ Summary: A universal backtesting framework for financial strategies using the IVolatility API.
5
+ Author-email: IVolatility <support@ivolatility.com>
6
+ Project-URL: Homepage, https://ivolatility.com
7
+ Keywords: backtesting,finance,trading,ivolatility
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+ Requires-Dist: pandas<3.0,>=1.5.0
19
+ Requires-Dist: numpy<3.0,>=1.21.0
20
+ Requires-Dist: matplotlib>=3.5.0
21
+ Requires-Dist: seaborn>=0.11.0
22
+ Requires-Dist: ivolatility>=1.9.6
23
+ Requires-Dist: psutil>=7.1.0
24
+
25
+ # IVolatility Backtesting
26
+ A universal backtesting framework for financial strategies using the IVolatility API.
27
+
28
+ ## Installation
29
+ ```bash
30
+ pip install ivolatility_backtesting
31
+ ```
32
+
33
+ ## Usage
34
+ ```python
35
+ from ivolatility_backtesting import run_backtest, init_api
36
+
37
+ # Initialize API
38
+ init_api("your-api-key")
39
+
40
+ # Define your strategy
41
+ def my_strategy(config):
42
+ # Strategy logic
43
+ return BacktestResults(
44
+ equity_curve=[100000, 110000],
45
+ equity_dates=["2023-01-01", "2023-01-02"],
46
+ trades=[{"pnl": 1000, "entry_date": "2023-01-01", "exit_date": "2023-01-02"}],
47
+ initial_capital=100000,
48
+ config=config
49
+ )
50
+
51
+ # Run backtest
52
+ CONFIG = {
53
+ "initial_capital": 100000,
54
+ "start_date": "2023-01-01",
55
+ "end_date": "2024-01-01",
56
+ "strategy_name": "My Strategy"
57
+ }
58
+ analyzer = run_backtest(my_strategy, CONFIG)
59
+
60
+ # Access metrics
61
+ print(f"Sharpe Ratio: {analyzer.metrics['sharpe']:.2f}")
62
+ ```
63
+
64
+ ## Requirements
65
+ - Python >= 3.8
66
+ - pandas >= 1.5.0
67
+ - numpy >= 1.21.0
68
+ - matplotlib >= 3.5.0
69
+ - seaborn >= 0.11.0
70
+ - ivolatility >= 1.8.2
71
+
72
+ ## Test CI
73
+ ## Test CI1
@@ -0,0 +1,49 @@
1
+ # IVolatility Backtesting
2
+ A universal backtesting framework for financial strategies using the IVolatility API.
3
+
4
+ ## Installation
5
+ ```bash
6
+ pip install ivolatility_backtesting
7
+ ```
8
+
9
+ ## Usage
10
+ ```python
11
+ from ivolatility_backtesting import run_backtest, init_api
12
+
13
+ # Initialize API
14
+ init_api("your-api-key")
15
+
16
+ # Define your strategy
17
+ def my_strategy(config):
18
+ # Strategy logic
19
+ return BacktestResults(
20
+ equity_curve=[100000, 110000],
21
+ equity_dates=["2023-01-01", "2023-01-02"],
22
+ trades=[{"pnl": 1000, "entry_date": "2023-01-01", "exit_date": "2023-01-02"}],
23
+ initial_capital=100000,
24
+ config=config
25
+ )
26
+
27
+ # Run backtest
28
+ CONFIG = {
29
+ "initial_capital": 100000,
30
+ "start_date": "2023-01-01",
31
+ "end_date": "2024-01-01",
32
+ "strategy_name": "My Strategy"
33
+ }
34
+ analyzer = run_backtest(my_strategy, CONFIG)
35
+
36
+ # Access metrics
37
+ print(f"Sharpe Ratio: {analyzer.metrics['sharpe']:.2f}")
38
+ ```
39
+
40
+ ## Requirements
41
+ - Python >= 3.8
42
+ - pandas >= 1.5.0
43
+ - numpy >= 1.21.0
44
+ - matplotlib >= 3.5.0
45
+ - seaborn >= 0.11.0
46
+ - ivolatility >= 1.8.2
47
+
48
+ ## Test CI
49
+ ## Test CI1
@@ -31,6 +31,8 @@ from .ivolatility_backtesting import (
31
31
  parse_earnings_calendar,
32
32
  SharedCacheTakenError,
33
33
  select_entry_at_time,
34
+ find_entry_minute, LookaheadError,
35
+ momentum_rotation_strategy,
34
36
  )
35
37
 
36
38
  __all__ = [
@@ -66,4 +68,6 @@ __all__ = [
66
68
  'parse_earnings_calendar',
67
69
  'SharedCacheTakenError',
68
70
  'select_entry_at_time',
71
+ 'find_entry_minute', 'LookaheadError',
72
+ 'momentum_rotation_strategy',
69
73
  ]