bquant 0.0.22__tar.gz → 0.0.23__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.
- {bquant-0.0.22 → bquant-0.0.23}/CHANGELOG.md +15 -0
- {bquant-0.0.22/bquant.egg-info → bquant-0.0.23}/PKG-INFO +2 -2
- {bquant-0.0.22 → bquant-0.0.23}/README.md +1 -1
- {bquant-0.0.22 → bquant-0.0.23}/bquant/__init__.py +1 -1
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/evaluation/__init__.py +6 -0
- bquant-0.0.23/bquant/analysis/evaluation/costs.py +183 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/processor.py +27 -4
- {bquant-0.0.22 → bquant-0.0.23/bquant.egg-info}/PKG-INFO +2 -2
- {bquant-0.0.22 → bquant-0.0.23}/bquant.egg-info/SOURCES.txt +4 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/evaluation.md +47 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/data/processor.md +22 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/versioning.md +5 -5
- {bquant-0.0.22 → bquant-0.0.23}/pyproject.toml +1 -1
- bquant-0.0.23/tests/fixtures/evaluation/costs/expected.json +2377 -0
- bquant-0.0.23/tests/unit/test_costs_and_wilder_atr_reproduce_the_reference.py +170 -0
- {bquant-0.0.22 → bquant-0.0.23}/LICENSE +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/MANIFEST.in +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/__main__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/candlestick/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/chart/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/evaluation/baseline.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/evaluation/bootstrap.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/evaluation/criterion.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/evaluation/procedure.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/evaluation/quarters.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/evaluation/trades.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/statistical/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/statistical/hypothesis_testing.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/statistical/regression.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/technical/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/timeseries/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/validation/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/validation/suite.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/analyzer.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/cache.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/detection/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/detection/base.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/detection/combined.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/detection/line_crossing.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/detection/preloaded.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/detection/registry.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/detection/threshold.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/detection/zero_crossing.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/models.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/pipeline.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/presets.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/sequence_analysis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/base.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/divergence/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/divergence/classic.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/factory.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/registry.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/shape/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/shape/statistical.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/swing/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/swing/find_peaks.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/swing/pivot_points.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/swing/presets.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/swing/thresholds.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/swing/zigzag.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/volatility/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/volatility/combined.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/volume/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/strategies/volume/standard.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/analysis/zones/zone_features.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/cli.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/cache.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/config.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/exceptions.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/logging_config.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/nb.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/numpy_fix.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/performance.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/core/utils.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/loader.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/samples/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/samples/datasets.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/samples/embedded/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/samples/embedded/mt_xauusd_m15.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/samples/embedded/tv_xauusd_1h.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/samples/generator.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/samples/utils.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/schemas.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/data/validator.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/base.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/calculators.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/custom/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/custom/bollinger.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/custom/ema.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/custom/macd.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/custom/rsi.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/custom/sma.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/library/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/library/manager.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/library/pandas_ta.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/library/talib.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/output_schema.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/preloaded/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/preloaded/macd.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/indicators/schema.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/visualization/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/visualization/charts.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/visualization/export.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/visualization/statistical.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/visualization/themes.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/visualization/utils.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant/visualization/zones.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant.egg-info/dependency_links.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant.egg-info/entry_points.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant.egg-info/requires.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/bquant.egg-info/top_level.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/analytics/zones/macd_zone_consistency_case_study.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/analytics/zones/swing.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/analytics/zones/swing_strategy_comparison_case_study.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/base.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/pipeline.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/statistical.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/strategies.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/zones/models.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/zones/pipeline.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/zones/strategies.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/analysis/zones.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/core/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/core/config.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/core/exceptions.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/core/logging.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/core/nb.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/core/performance.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/core/utils.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/data/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/data/loader.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/data/processor.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/data/samples.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/data/schemas.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/data/validator.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/extension_guide.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/indicators/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/indicators/base.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/indicators/factory.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/indicators/library_manager.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/indicators/macd.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/indicators/preloaded.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/visualization/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/api/visualization/zones.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/developer_guide/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/developer_guide/analytical_philosophy.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/developer_guide/statistical_analysis_workflow.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/developer_guide/zone_analyzer_deep_dive.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/developer_guide/zone_detection_strategies.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/examples/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/index.rst.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/migration/MIGRATION_v2.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/migration/global_swings_migration.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/tutorials/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/tutorials/combined_rules_detection.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/tutorials/macd_basic_pipeline.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/tutorials/preloaded_zones_workflow.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/tutorials/rsi_strategy_switching.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/user_guide/README.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/user_guide/best_practices.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/user_guide/caching.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/user_guide/core_concepts.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/user_guide/quick_start.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/user_guide/swing_analysis_results.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/user_guide/swing_strategies.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/_build/html/_sources/user_guide/zone_analysis.md.txt +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/analytics/zones/swing_strategy_comparison_case_study.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/analytics/zones/swing_zone_scale_threshold_study.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/base.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/pipeline.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/statistical.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/strategies.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/zones/global_swings_models.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/zones/global_swings_pipeline.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/zones/global_swings_strategies.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/analysis/zones.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/core/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/core/config.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/core/exceptions.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/core/logging.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/core/nb.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/core/performance.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/core/utils.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/data/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/data/loader.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/data/samples.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/data/schemas.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/data/validator.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/extension_guide.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/indicators/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/indicators/base.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/indicators/custom.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/indicators/factory.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/indicators/library_manager.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/indicators/macd.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/indicators/preloaded.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/visualization/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/api/visualization/zones.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/developer_guide/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/developer_guide/analytical_philosophy.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/developer_guide/statistical_analysis_workflow.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/developer_guide/zone_analyzer_deep_dive.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/developer_guide/zone_detection_strategies.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/examples/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/index.rst +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/migration/global_swings_migration.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/tutorials/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/tutorials/combined_rules_detection.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/tutorials/macd_basic_pipeline.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/tutorials/preloaded_zones_workflow.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/tutorials/rsi_strategy_switching.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/best_practices.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/caching.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/cli.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/core_concepts.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/quick_start.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/swing_strategies.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/zone_analysis.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/docs/user_guide/zone_analysis_result.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/01_basic_indicators.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/02_macd_zone_analysis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/02a_universal_zones.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/03_data_processing.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/04_comprehensive_analysis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/05_strategies_demo.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/06_regression_demo.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/07_validation_demo.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/08_macd_swing_analysis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/09_zones_visualization_demo.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/examples/zone_analysis_global_swings.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/analysis/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/analysis/batch_analysis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/analysis/run_hypothesis_tests.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/analysis/run_macd_analysis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/data/data_loader.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/data/extract_samples.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/data/generate_samples.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/data_processing/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/deployment/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/scripts/publishing/README.md +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/setup.cfg +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/analysis/test_statistical_levers_change_the_answer.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/analysis/zones/test_pipeline_cache.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/analysis/zones/test_swing_presets.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/analysis/zones/test_swing_thresholds.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/conftest.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/fixtures/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/fixtures/evaluation/baseline/expected.json +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/fixtures/evaluation/expected.json +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/fixtures/swing_coverage.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/fixtures/swing_mocks.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_cache_serves_what_was_asked.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_data_pipeline.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_docs_examples_run.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_full_pipeline.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_pipeline_global_swings.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_scripts_integration.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_the_hypothesis_script_reports_what_ran.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_truly_universal_zones.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_visualization_pipeline.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/integration/test_zone_analysis_e2e.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/performance/test_swing_performance.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/__init__.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_a_bar_on_the_level_keeps_the_previous_side.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_a_declared_rule_must_move_the_result.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_a_loaded_file_has_a_time_axis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_a_strategy_written_to_the_protocol_works.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_a_stub_says_so.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_a_swing_strategy_that_finds_nothing_says_so.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_all_indicator_types.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_an_absent_metric_is_not_a_zero.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_analysis_structure.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_architecture_validation.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_builtin_migration.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_cache_key_covers_what_the_result_reads.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_cache_key_sees_the_analysis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_cache_versioning.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_changelog_marks_what_it_breaks.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_classic_divergence_strategy.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_clean_interpolates_numbers_only.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_cli_says_what_it_does.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_combined_volatility_strategy.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_compatibility_validation.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_config_refuses_with_the_project_hierarchy.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_consumers_address_by_role.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_contracts_are_checked.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_core_modules.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_data_contracts_agree_between_layers.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_data_levers_change_the_answer.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_data_modules.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_detect_zones_rejects_unknown_rules.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_divergence_strategy_universal.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_docs_call_signatures.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_docs_parity.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_every_builder_lever_is_observable.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_factory_names_the_missing_library.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_features_and_statistics_measure_what_they_name.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_find_peaks_swing_strategy.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_global_state_has_a_contract.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_hygiene_holds.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_imports_migration.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_indicator_column_schema.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_indicator_factory.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_indicator_identity_renderable.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_indicator_implementations_agree.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_indicator_output_columns.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_indicators_base.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_indicators_do_not_publish_an_unfilled_window.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_install_footprint.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_invariants_hold_on_generated_data.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_layers_point_one_way.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_library_indicators.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_library_registration_does_not_freeze_on_an_early_pass.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_min_duration_is_a_reporting_filter.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_module_entry_point.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_no_removed_pandas_api.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_no_shadowed_definitions.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_no_silent_skips_on_bquant_imports.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_one_mechanism_one_implementation.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_optimized_indicators_measure_what_they_claim.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_pandas_ta_dynamic_loader.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_per_zone_swings_share_the_global_detector.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_performance.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_persistence_keeps_what_the_result_holds.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_pivot_points_swing_strategy.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_preloaded_columns_are_the_columns_requested.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_preloaded_helper_resolves_the_sample_clock.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_preloaded_indicators.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_preparation_does_not_return_an_empty_frame.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_public_name_collisions.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_public_surface_is_documented.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_sample_data.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_sample_generator.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_schema_validation_forms_a_verdict.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_scripts_parity.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_shape_strategy_universal.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_standard_volume_strategy.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_statistical_hypothesis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_statistical_shape_strategy.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_status_claims_match_the_registry.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_strategy_infrastructure.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_swing_context_memory.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_swing_edge_cases.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_swing_global_calculation.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_swing_replay_causal.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_aggregate_speaks_the_indicator_vocabulary.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_amplitude_floor_is_the_zone_scale.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_analysis_input_has_a_contract.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_cache_key_sees_the_package_version.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_data_layer_does_not_lean_on_a_deprecated_keyword.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_declared_period_is_the_period_shipped.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_empty_swing_context_names_its_reason.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_error_context_carries_details_not_prose.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_factory_builds_what_it_lists.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_library_catalogue_answers_the_same_before_and_after_loading.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_monitor_decorator_works_written_either_way.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_package_has_one_version.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_random_baseline_tells_exits_apart.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_reference_fixture_reproduces_in_the_package.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_sequence_test_needs_a_declared_vocabulary.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_theme_argument_is_honoured_or_refused.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_trade_frame_edges_are_decided_not_implied.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_the_zigzag_threshold_is_the_percent_the_library_reads.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_time_metrics.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_timeframe_means_what_it_says.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_two_kinds_of_zone.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_universal_zone_analyzer.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_validation_knows_what_it_compares.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_validation_reads_the_metric_it_was_asked_for.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_validation_suite.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_visualization.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_visualization_does_not_pay_for_what_it_does_not_use.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_volume_strategy_universal.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zigzag_swing_strategy.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_analysis_builder.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_boundaries_carry_time.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_detection_strategies.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_features_analyzer_context.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_features_directional_metrics.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_features_divergence_integration.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_features_shape_integration.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_features_swing_integration.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_features_volatility_integration.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_features_volume_integration.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_models.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_pipeline.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_presets.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_regression_analyzer.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_regression_wiring.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_sequence_adjacency.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_type_vocabulary.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zone_visualization_polarity.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/unit/test_zones_analysis.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/visualization/test_infrastructure.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/visualization/test_levers_change_the_figure.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/visualization/test_swing_overlay.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/visualization/test_zone_metrics_aggregation.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/visualization/test_zone_metrics_display.py +0 -0
- {bquant-0.0.22 → bquant-0.0.23}/tests/visualization/test_zones_visualization.py +0 -0
|
@@ -9,6 +9,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.0.23] - 2026-11-04
|
|
13
|
+
|
|
14
|
+
**Издержки сделки и ATR Уайлдера** — заказ лаборатории стратегий, нужен двум потребителям.
|
|
15
|
+
- `bquant.analysis.evaluation.rollover_nights(entry_time, exit_time, *, triple_weekday=2)` считает ночи
|
|
16
|
+
свопа по календарю сервера. Ночи после субботы и воскресенья не начисляются, ночь после
|
|
17
|
+
`triple_weekday` идёт за три, неделя — 7 ночей.
|
|
18
|
+
- `CostModel(...).round_trip(spread_points, entry_idx, side, nights)` считает издержки круга в
|
|
19
|
+
пунктах: спред бара входа или фиксированный, нижняя граница спреда, комиссия, своп со знаком
|
|
20
|
+
MetaTrader. `CostModel.from_symbol_spec` читает своп из спецификации символа MT5.
|
|
21
|
+
- `calculate_atr(df, period, method='wilder')` — сглаживание Уайлдера. Без `method` ATR прежний,
|
|
22
|
+
скользящее среднее.
|
|
23
|
+
- Отказ, а не молчаливая подмена: модель со свопом без `nights`, `triple_weekday` в выходной,
|
|
24
|
+
спецификация со своп не в пунктах или без дня тройной ночи. Фикстура лаборатории
|
|
25
|
+
воспроизводится до `1e-9`.
|
|
26
|
+
|
|
12
27
|
## [0.0.22] - 2026-11-04
|
|
13
28
|
|
|
14
29
|
**Режим выхода в случайном базисе.** `random_entry_baseline` принимает `modes={метка: хвост}`:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bquant
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.23
|
|
4
4
|
Summary: Quantitative research toolkit for financial markets
|
|
5
5
|
Author-email: kogriv <kogriv@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -194,7 +194,7 @@ support it; `research/` and `scripts/` hold notebook-style studies and automatio
|
|
|
194
194
|
## Status
|
|
195
195
|
|
|
196
196
|
Beta. The public API changes between releases without deprecation windows — renames are
|
|
197
|
-
carried through in one change. **Pin an exact version:** `bquant>=0.0.
|
|
197
|
+
carried through in one change. **Pin an exact version:** `bquant>=0.0.23,<0.0.24`.
|
|
198
198
|
|
|
199
199
|
Breaking changes ship in the patch number, and the dangerous ones do not raise: when a
|
|
200
200
|
defect in a calculation is fixed, nothing fails to import — your numbers change, and the
|
|
@@ -131,7 +131,7 @@ support it; `research/` and `scripts/` hold notebook-style studies and automatio
|
|
|
131
131
|
## Status
|
|
132
132
|
|
|
133
133
|
Beta. The public API changes between releases without deprecation windows — renames are
|
|
134
|
-
carried through in one change. **Pin an exact version:** `bquant>=0.0.
|
|
134
|
+
carried through in one change. **Pin an exact version:** `bquant>=0.0.23,<0.0.24`.
|
|
135
135
|
|
|
136
136
|
Breaking changes ship in the patch number, and the dangerous ones do not raise: when a
|
|
137
137
|
defect in a calculation is fixed, nothing fails to import — your numbers change, and the
|
|
@@ -5,7 +5,7 @@ A comprehensive toolkit for quantitative analysis of financial data,
|
|
|
5
5
|
starting with MACD analysis and expandable to all aspects of market research.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "0.0.
|
|
8
|
+
__version__ = "0.0.23"
|
|
9
9
|
__author__ = "kogriv"
|
|
10
10
|
__email__ = "kogriv@gmail.com"
|
|
11
11
|
|
|
@@ -13,6 +13,10 @@ four questions a single backtest number cannot:
|
|
|
13
13
|
and is a run's result spread over **quarters** or made in one stretch
|
|
14
14
|
(:func:`quarterly_summary`).
|
|
15
15
|
|
|
16
|
+
What a round trip costs — spread, commission and swap over the nights held — is
|
|
17
|
+
:class:`CostModel` with :func:`rollover_nights`; the outcome functions the baseline
|
|
18
|
+
averages are where it usually goes.
|
|
19
|
+
|
|
16
20
|
The package holds no registry of variants, no notion of zones or bars, and no data: the
|
|
17
21
|
number of tests corrected for comes from the caller, as does the outcome function the
|
|
18
22
|
baseline averages.
|
|
@@ -20,6 +24,7 @@ baseline averages.
|
|
|
20
24
|
|
|
21
25
|
from .baseline import attach_random_baseline, random_entry_baseline
|
|
22
26
|
from .bootstrap import BlockBootstrap
|
|
27
|
+
from .costs import CostModel, rollover_nights
|
|
23
28
|
from .criterion import (
|
|
24
29
|
BeatsRandom,
|
|
25
30
|
Criterion,
|
|
@@ -47,6 +52,7 @@ from .trades import month_key, month_label, months_between, validate_trades
|
|
|
47
52
|
__all__ = [
|
|
48
53
|
"validate_trades", "month_key", "month_label", "months_between",
|
|
49
54
|
"BlockBootstrap",
|
|
55
|
+
"CostModel", "rollover_nights",
|
|
50
56
|
"random_entry_baseline", "attach_random_baseline",
|
|
51
57
|
"trial_stats", "benjamini_hochberg",
|
|
52
58
|
"Rule", "MinTrades", "NetPositive", "YearsStable", "BeatsRandom", "MinEffect",
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"""What a round trip costs: the spread, the commission, and the swap over the nights held.
|
|
2
|
+
|
|
3
|
+
Everything is in **points of the symbol** (price = points × point); a positive number is
|
|
4
|
+
an expense. Dividing by ATR, or by anything else, is the caller's business.
|
|
5
|
+
|
|
6
|
+
Two pieces:
|
|
7
|
+
|
|
8
|
+
* :func:`rollover_nights` — how many swap nights a trade held, by the server calendar:
|
|
9
|
+
a midnight ``m`` with ``entry < m <= exit`` is charged when the day it closes is a
|
|
10
|
+
weekday (Monday … Friday); the midnight after ``triple_weekday`` counts three times,
|
|
11
|
+
so a full week is seven nights, as in MetaTrader.
|
|
12
|
+
* :class:`CostModel` — the cost of one round trip given the spread of the entry bar,
|
|
13
|
+
the side and the nights.
|
|
14
|
+
|
|
15
|
+
Bars from MetaTrader are bid prices: a buy opens at ask and a sell closes at ask, so a
|
|
16
|
+
round trip pays **one** spread. The spread recorded for a historical bar is what the
|
|
17
|
+
server stored for it (often the smallest of the bar), not an average — hence the floor
|
|
18
|
+
``min_spread_points`` and the ``"fixed"`` mode for a stress test.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
from dataclasses import dataclass
|
|
24
|
+
from typing import Any, Mapping, Optional
|
|
25
|
+
|
|
26
|
+
import numpy as np
|
|
27
|
+
import pandas as pd
|
|
28
|
+
|
|
29
|
+
_DAY_NS = 86_400 * 10**9
|
|
30
|
+
_SPREAD_MODES = ("bar", "fixed")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _check_triple_weekday(value: Any) -> int:
|
|
34
|
+
if not isinstance(value, (int, np.integer)) or isinstance(value, bool) or not 0 <= int(value) <= 4:
|
|
35
|
+
raise ValueError(
|
|
36
|
+
f"triple_weekday must be a weekday 0 (Monday) … 4 (Friday), got {value!r}: the nights "
|
|
37
|
+
"after Saturday and Sunday are not charged, so a triple night there would never count"
|
|
38
|
+
)
|
|
39
|
+
return int(value)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _wall_clock_ns(times: Any, name: str) -> np.ndarray:
|
|
43
|
+
values = times if isinstance(times, (pd.Series, pd.Index)) else np.atleast_1d(times)
|
|
44
|
+
index = pd.DatetimeIndex(pd.to_datetime(values))
|
|
45
|
+
if index.tz is not None:
|
|
46
|
+
index = index.tz_localize(None) # keep the wall clock of the zone given: pass server time
|
|
47
|
+
if index.hasnans:
|
|
48
|
+
raise ValueError(f"{name} has missing times")
|
|
49
|
+
return index.as_unit("ns").asi8
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def rollover_nights(entry_time: Any, exit_time: Any, *, triple_weekday: int = 2) -> np.ndarray:
|
|
53
|
+
"""Swap nights between each entry and exit, as an integer array.
|
|
54
|
+
|
|
55
|
+
``entry_time`` and ``exit_time`` are paired times (scalars, arrays, Series or an
|
|
56
|
+
index) on the **broker's server clock**. A time with a timezone is read by its own
|
|
57
|
+
wall clock — convert it to the server zone first. The exit is the moment the
|
|
58
|
+
position closes: the close of the last bar (its open time plus one bar) or the open
|
|
59
|
+
of the next one.
|
|
60
|
+
|
|
61
|
+
``triple_weekday`` is the day whose closing midnight counts three times, 0 = Monday;
|
|
62
|
+
most brokers use 2 (Wednesday, the night into Thursday). A symbol specification from
|
|
63
|
+
MetaTrader numbers the day from Sunday = 0: ``triple_weekday = (swap_rollover3day - 1) % 7``
|
|
64
|
+
— :meth:`CostModel.from_symbol_spec` does that.
|
|
65
|
+
"""
|
|
66
|
+
triple = _check_triple_weekday(triple_weekday)
|
|
67
|
+
entry = _wall_clock_ns(entry_time, "entry_time")
|
|
68
|
+
exit_ = _wall_clock_ns(exit_time, "exit_time")
|
|
69
|
+
if entry.shape != exit_.shape:
|
|
70
|
+
raise ValueError(f"entry_time and exit_time differ in length: {entry.size} and {exit_.size}")
|
|
71
|
+
if (exit_ < entry).any():
|
|
72
|
+
first = int(np.flatnonzero(exit_ < entry)[0])
|
|
73
|
+
raise ValueError(f"exit before entry at position {first}")
|
|
74
|
+
# Midnights are counted by day number since 1970-01-01 (a Thursday). The midnight that
|
|
75
|
+
# opens day D closes day D - 1, whose weekday (Monday = 0) is (D + 2) % 7.
|
|
76
|
+
first_day = entry // _DAY_NS # midnights strictly after entry start at first_day + 1
|
|
77
|
+
last_day = exit_ // _DAY_NS # ... and end at last_day (a midnight equal to exit counts)
|
|
78
|
+
nights = np.zeros(entry.shape, dtype=np.int64)
|
|
79
|
+
for closed in range(5): # Monday … Friday
|
|
80
|
+
residue = (closed - 2) % 7 # day numbers D with (D + 2) % 7 == closed, i.e. D % 7 == residue
|
|
81
|
+
count = (last_day - residue) // 7 - (first_day - residue) // 7
|
|
82
|
+
nights += count * (3 if closed == triple else 1)
|
|
83
|
+
return nights
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@dataclass(frozen=True)
|
|
87
|
+
class CostModel:
|
|
88
|
+
"""The cost of a round trip, in points.
|
|
89
|
+
|
|
90
|
+
``spread``: ``"bar"`` takes the spread of the entry bar (never below
|
|
91
|
+
``min_spread_points``; a missing value is 0), ``"fixed"`` takes
|
|
92
|
+
``fixed_spread_points``. ``commission_points`` is per round trip (entry and exit).
|
|
93
|
+
``swap_long_points`` / ``swap_short_points`` are per night with MetaTrader's sign —
|
|
94
|
+
a negative swap is paid, so it **adds** to the cost; ``triple_weekday`` is the day
|
|
95
|
+
whose night counts three times (0 = Monday).
|
|
96
|
+
|
|
97
|
+
``cost = spread + commission - swap(side) * nights``.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
spread: str = "bar"
|
|
101
|
+
fixed_spread_points: float = 0.0
|
|
102
|
+
min_spread_points: float = 0.0
|
|
103
|
+
commission_points: float = 0.0
|
|
104
|
+
swap_long_points: float = 0.0
|
|
105
|
+
swap_short_points: float = 0.0
|
|
106
|
+
triple_weekday: int = 2
|
|
107
|
+
|
|
108
|
+
def __post_init__(self) -> None:
|
|
109
|
+
if self.spread not in _SPREAD_MODES:
|
|
110
|
+
raise ValueError(f"spread must be one of {_SPREAD_MODES}, got {self.spread!r}")
|
|
111
|
+
for name in ("fixed_spread_points", "min_spread_points", "commission_points",
|
|
112
|
+
"swap_long_points", "swap_short_points"):
|
|
113
|
+
value = getattr(self, name)
|
|
114
|
+
if isinstance(value, bool) or not isinstance(value, (int, float, np.integer, np.floating)) or not np.isfinite(value):
|
|
115
|
+
raise ValueError(f"{name} must be a finite number, got {value!r}")
|
|
116
|
+
_check_triple_weekday(self.triple_weekday)
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def uses_swap(self) -> bool:
|
|
120
|
+
"""Whether the model charges swap, and so needs the nights."""
|
|
121
|
+
return bool(self.swap_long_points or self.swap_short_points)
|
|
122
|
+
|
|
123
|
+
def round_trip(self, spread_points: Optional[Any], entry_idx: Any, side: Any,
|
|
124
|
+
nights: Optional[Any] = None) -> np.ndarray:
|
|
125
|
+
"""Cost of each round trip in points.
|
|
126
|
+
|
|
127
|
+
``spread_points`` is the spread of every bar (indexed by ``entry_idx``; it may be
|
|
128
|
+
``None`` in the ``"fixed"`` mode), ``entry_idx`` the entry bars, ``side`` +1 or -1
|
|
129
|
+
per trade, ``nights`` the swap nights per trade (:func:`rollover_nights`) —
|
|
130
|
+
required when the model charges swap, and ignored when it does not.
|
|
131
|
+
"""
|
|
132
|
+
entry = np.atleast_1d(np.asarray(entry_idx))
|
|
133
|
+
if not np.issubdtype(entry.dtype, np.integer):
|
|
134
|
+
raise ValueError(f"entry_idx must be integer bar positions, got dtype {entry.dtype}")
|
|
135
|
+
sides = np.broadcast_to(np.asarray(side), entry.shape)
|
|
136
|
+
if not np.isin(sides, (1, -1)).all():
|
|
137
|
+
raise ValueError("side must be +1 or -1 for every trade")
|
|
138
|
+
if self.spread == "bar":
|
|
139
|
+
if spread_points is None:
|
|
140
|
+
raise ValueError("the 'bar' spread mode needs spread_points, the spread of every bar")
|
|
141
|
+
bar = np.nan_to_num(np.asarray(spread_points, dtype=float)[entry], nan=0.0)
|
|
142
|
+
spread = np.maximum(bar, self.min_spread_points)
|
|
143
|
+
else:
|
|
144
|
+
spread = np.full(entry.shape, float(self.fixed_spread_points))
|
|
145
|
+
cost = spread + self.commission_points
|
|
146
|
+
if self.uses_swap:
|
|
147
|
+
if nights is None:
|
|
148
|
+
raise ValueError(
|
|
149
|
+
"this model charges swap, so round_trip needs nights (see rollover_nights); "
|
|
150
|
+
"without them the swap would silently drop out of the cost"
|
|
151
|
+
)
|
|
152
|
+
held = np.broadcast_to(np.asarray(nights), entry.shape)
|
|
153
|
+
if not np.issubdtype(held.dtype, np.integer) or (held < 0).any():
|
|
154
|
+
raise ValueError("nights must be non-negative whole numbers")
|
|
155
|
+
per_night = np.where(sides > 0, self.swap_long_points, self.swap_short_points)
|
|
156
|
+
cost = cost - per_night * held
|
|
157
|
+
return cost
|
|
158
|
+
|
|
159
|
+
@classmethod
|
|
160
|
+
def from_symbol_spec(cls, spec: Mapping[str, Any], **costs: Any) -> "CostModel":
|
|
161
|
+
"""A model whose swap comes from a MetaTrader symbol specification.
|
|
162
|
+
|
|
163
|
+
``spec`` needs ``swap_mode`` (only 1 — swap in points — is accepted),
|
|
164
|
+
``swap_long``, ``swap_short`` and ``swap_rollover3day`` (Sunday = 0). The other
|
|
165
|
+
fields of the model (``spread``, ``fixed_spread_points``, ``min_spread_points``,
|
|
166
|
+
``commission_points``) come as keywords.
|
|
167
|
+
"""
|
|
168
|
+
if spec.get("swap_mode") != 1:
|
|
169
|
+
raise ValueError(
|
|
170
|
+
f"swap_mode is {spec.get('swap_mode')!r}: only 1 (swap in points) can be read as points"
|
|
171
|
+
)
|
|
172
|
+
missing = [key for key in ("swap_long", "swap_short", "swap_rollover3day") if key not in spec]
|
|
173
|
+
if missing:
|
|
174
|
+
raise ValueError(f"the symbol specification has no {', '.join(missing)}")
|
|
175
|
+
swap_fields = {"swap_long_points", "swap_short_points", "triple_weekday"} & set(costs)
|
|
176
|
+
if swap_fields:
|
|
177
|
+
raise ValueError(f"{sorted(swap_fields)} come from the specification, not as keywords")
|
|
178
|
+
return cls(
|
|
179
|
+
swap_long_points=float(spec["swap_long"]),
|
|
180
|
+
swap_short_points=float(spec["swap_short"]),
|
|
181
|
+
triple_weekday=(int(spec["swap_rollover3day"]) - 1) % 7,
|
|
182
|
+
**costs,
|
|
183
|
+
)
|
|
@@ -278,18 +278,41 @@ def calculate_true_range(df: pd.DataFrame) -> pd.Series:
|
|
|
278
278
|
return candidates.max(axis=1, skipna=True)
|
|
279
279
|
|
|
280
280
|
|
|
281
|
-
def calculate_atr(df: pd.DataFrame, period: int = 14) -> pd.Series:
|
|
282
|
-
"""Average True Range
|
|
281
|
+
def calculate_atr(df: pd.DataFrame, period: int = 14, method: str = "sma") -> pd.Series:
|
|
282
|
+
"""Average True Range of :func:`calculate_true_range` over ``period`` bars.
|
|
283
283
|
|
|
284
284
|
The one ATR the package computes. The pipeline adds it to the analysed
|
|
285
285
|
frame as ``atr`` when the caller did not bring one (G60): until then the
|
|
286
286
|
branch waiting for it was unreachable, and ``atr_normalized_return`` was
|
|
287
287
|
``None`` in every zone of the flagship path. The first ``period - 1``
|
|
288
|
-
values are ``NaN`` — the window is not full.
|
|
288
|
+
values are ``NaN`` in both methods — the window is not full.
|
|
289
|
+
|
|
290
|
+
``method`` picks the average:
|
|
291
|
+
|
|
292
|
+
* ``"sma"`` (the default) — the rolling mean of the last ``period`` true ranges;
|
|
293
|
+
* ``"wilder"`` — Wilder's smoothing: the first value (bar ``period - 1``) is the
|
|
294
|
+
mean of the first ``period`` true ranges, each later one
|
|
295
|
+
``atr[i] = atr[i-1] + (tr[i] - atr[i-1]) / period``. This is the ATR of most
|
|
296
|
+
trading terminals; it remembers the whole history, so two frames that start on
|
|
297
|
+
different bars give different values on the same bar.
|
|
289
298
|
"""
|
|
290
299
|
if not isinstance(period, int) or isinstance(period, bool) or period <= 0:
|
|
291
300
|
raise ValueError(f"ATR period must be a positive integer, got {period!r}")
|
|
292
|
-
|
|
301
|
+
if method not in _ATR_METHODS:
|
|
302
|
+
raise ValueError(f"ATR method must be one of {_ATR_METHODS}, got {method!r}")
|
|
303
|
+
tr = calculate_true_range(df)
|
|
304
|
+
if method == "sma":
|
|
305
|
+
return tr.rolling(window=period).mean()
|
|
306
|
+
values = tr.to_numpy(dtype=float)
|
|
307
|
+
out = np.full(len(values), np.nan)
|
|
308
|
+
if len(values) >= period:
|
|
309
|
+
out[period - 1] = values[:period].mean()
|
|
310
|
+
for i in range(period, len(values)):
|
|
311
|
+
out[i] = out[i - 1] + (values[i] - out[i - 1]) / period
|
|
312
|
+
return pd.Series(out, index=tr.index)
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
_ATR_METHODS = ("sma", "wilder")
|
|
293
316
|
|
|
294
317
|
|
|
295
318
|
def calculate_derived_indicators(df: pd.DataFrame) -> pd.DataFrame:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bquant
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.23
|
|
4
4
|
Summary: Quantitative research toolkit for financial markets
|
|
5
5
|
Author-email: kogriv <kogriv@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -194,7 +194,7 @@ support it; `research/` and `scripts/` hold notebook-style studies and automatio
|
|
|
194
194
|
## Status
|
|
195
195
|
|
|
196
196
|
Beta. The public API changes between releases without deprecation windows — renames are
|
|
197
|
-
carried through in one change. **Pin an exact version:** `bquant>=0.0.
|
|
197
|
+
carried through in one change. **Pin an exact version:** `bquant>=0.0.23,<0.0.24`.
|
|
198
198
|
|
|
199
199
|
Breaking changes ship in the patch number, and the dangerous ones do not raise: when a
|
|
200
200
|
defect in a calculation is fixed, nothing fails to import — your numbers change, and the
|
|
@@ -12,6 +12,7 @@ pyproject.toml
|
|
|
12
12
|
./bquant/analysis/evaluation/__init__.py
|
|
13
13
|
./bquant/analysis/evaluation/baseline.py
|
|
14
14
|
./bquant/analysis/evaluation/bootstrap.py
|
|
15
|
+
./bquant/analysis/evaluation/costs.py
|
|
15
16
|
./bquant/analysis/evaluation/criterion.py
|
|
16
17
|
./bquant/analysis/evaluation/procedure.py
|
|
17
18
|
./bquant/analysis/evaluation/quarters.py
|
|
@@ -117,6 +118,7 @@ bquant/analysis/chart/__init__.py
|
|
|
117
118
|
bquant/analysis/evaluation/__init__.py
|
|
118
119
|
bquant/analysis/evaluation/baseline.py
|
|
119
120
|
bquant/analysis/evaluation/bootstrap.py
|
|
121
|
+
bquant/analysis/evaluation/costs.py
|
|
120
122
|
bquant/analysis/evaluation/criterion.py
|
|
121
123
|
bquant/analysis/evaluation/procedure.py
|
|
122
124
|
bquant/analysis/evaluation/quarters.py
|
|
@@ -357,6 +359,7 @@ tests/fixtures/swing_coverage.py
|
|
|
357
359
|
tests/fixtures/swing_mocks.py
|
|
358
360
|
tests/fixtures/evaluation/expected.json
|
|
359
361
|
tests/fixtures/evaluation/baseline/expected.json
|
|
362
|
+
tests/fixtures/evaluation/costs/expected.json
|
|
360
363
|
tests/integration/__init__.py
|
|
361
364
|
tests/integration/test_cache_serves_what_was_asked.py
|
|
362
365
|
tests/integration/test_data_pipeline.py
|
|
@@ -394,6 +397,7 @@ tests/unit/test_config_refuses_with_the_project_hierarchy.py
|
|
|
394
397
|
tests/unit/test_consumers_address_by_role.py
|
|
395
398
|
tests/unit/test_contracts_are_checked.py
|
|
396
399
|
tests/unit/test_core_modules.py
|
|
400
|
+
tests/unit/test_costs_and_wilder_atr_reproduce_the_reference.py
|
|
397
401
|
tests/unit/test_data_contracts_agree_between_layers.py
|
|
398
402
|
tests/unit/test_data_levers_change_the_answer.py
|
|
399
403
|
tests/unit/test_data_modules.py
|
|
@@ -309,6 +309,53 @@ print(apply_rules(summary, default_quarter_rules()))
|
|
|
309
309
|
стороной и подлежащие пересмотру новым объектом. `apply_rules(summary, rules)` даёт флаги и
|
|
310
310
|
`pass`.
|
|
311
311
|
|
|
312
|
+
## Издержки сделки
|
|
313
|
+
|
|
314
|
+
Издержки круга сделки — в **пунктах** символа, положительное — расход; делить на ATR или на что
|
|
315
|
+
угодно ещё — дело вызывающего. Обычно они живут в функции исхода, которую усредняет случайный базис.
|
|
316
|
+
|
|
317
|
+
`rollover_nights(entry_time, exit_time, *, triple_weekday=2)` считает ночи свопа по календарю
|
|
318
|
+
сервера брокера. Полночь `m`, где `вход < m ≤ выход`, начисляется, если день, который она
|
|
319
|
+
завершает, — пн…пт: ночи после субботы и воскресенья не начисляются. Полночь после дня
|
|
320
|
+
`triple_weekday` (0 — понедельник; у большинства брокеров 2, ночь на четверг) идёт за три,
|
|
321
|
+
поэтому неделя — это 7 ночей. Время выхода — момент закрытия позиции: закрытие последнего бара
|
|
322
|
+
(его время плюс бар) или открытие следующего. Время с поясом читается по его собственным часам,
|
|
323
|
+
поэтому сначала переведите его в пояс сервера.
|
|
324
|
+
|
|
325
|
+
`CostModel` считает `спред + комиссия − своп(сторона) · ночи`:
|
|
326
|
+
|
|
327
|
+
```python
|
|
328
|
+
import numpy as np
|
|
329
|
+
import pandas as pd
|
|
330
|
+
|
|
331
|
+
from bquant.analysis.evaluation import CostModel, rollover_nights
|
|
332
|
+
|
|
333
|
+
entry = pd.to_datetime(['2022-01-04 10:00', '2022-01-05 15:00', '2022-01-07 12:00']) # Tue, Wed, Fri
|
|
334
|
+
exit_ = pd.to_datetime(['2022-01-04 18:00', '2022-01-06 09:00', '2022-01-10 08:00']) # same day, Thu, Mon
|
|
335
|
+
nights = rollover_nights(entry, exit_, triple_weekday=2) # the Wednesday night counts three
|
|
336
|
+
print(nights.tolist())
|
|
337
|
+
|
|
338
|
+
spec = {'swap_mode': 1, 'swap_long': -3.2, 'swap_short': 1.1, 'swap_rollover3day': 3} # MT5: Sunday = 0
|
|
339
|
+
model = CostModel.from_symbol_spec(spec, spread='bar', min_spread_points=15.0, commission_points=7.0)
|
|
340
|
+
spread = np.array([12.0, 25.0, np.nan]) # the spread of each entry bar; a missing one counts as 0
|
|
341
|
+
cost = model.round_trip(spread, entry_idx=[0, 1, 2], side=[1, 1, -1], nights=nights)
|
|
342
|
+
print(model.triple_weekday, cost.round(2).tolist())
|
|
343
|
+
# [0, 3, 1]
|
|
344
|
+
# 2 [22.0, 41.6, 20.9]
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
Бары MetaTrader — это цены bid, поэтому за круг платится **один** спред. В режиме `spread='bar'`
|
|
348
|
+
это спред бара входа: не меньше `min_spread_points`, пустой считается нулём. Режим `'fixed'` берёт
|
|
349
|
+
`fixed_spread_points`, это стресс-вариант. Своп указан со знаком MetaTrader: отрицательный
|
|
350
|
+
платится и прибавляется к издержкам. `from_symbol_spec` читает своп из спецификации символа,
|
|
351
|
+
где день недели считается от воскресенья: `triple_weekday = (swap_rollover3day − 1) % 7`.
|
|
352
|
+
|
|
353
|
+
Отказы, а не подмены:
|
|
354
|
+
- модели со свопом нужны `nights`; без них своп выпал бы из издержек без следа;
|
|
355
|
+
- `swap_mode ≠ 1` (своп не в пунктах) и спецификация без `swap_rollover3day` отклоняются;
|
|
356
|
+
- `triple_weekday` вне 0…4 отклоняется: тройная ночь в выходной никогда бы не начислилась;
|
|
357
|
+
- выход раньше входа и `side` не ±1 тоже отклоняются.
|
|
358
|
+
|
|
312
359
|
## От зон к оценке — пример стыковки
|
|
313
360
|
|
|
314
361
|
Пакет не превращает зоны в сделки: правила входа и выхода — решение торговой системы, а не
|
|
@@ -103,6 +103,28 @@ print([c for c in derived.columns if c not in data.columns])
|
|
|
103
103
|
именем `true_range` лежал `high - low`, а в `add_technical_features()` — True Range: два
|
|
104
104
|
числа под одной подписью, расходящиеся на каждом гэпе (G57).
|
|
105
105
|
|
|
106
|
+
`calculate_atr(df, period=14, method='sma')` усредняет True Range двумя способами. `'sma'`
|
|
107
|
+
(умолчание, его берёт пайплайн) — скользящее среднее последних `period` значений. `'wilder'` —
|
|
108
|
+
сглаживание Уайлдера, ATR большинства торговых терминалов: первое значение (бар `period − 1`) —
|
|
109
|
+
среднее первых `period` TR, дальше `atr[i] = atr[i−1] + (tr[i] − atr[i−1]) / period`. У обоих
|
|
110
|
+
первые `period − 1` значений — `NaN`:
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
from bquant.data import calculate_atr
|
|
114
|
+
from bquant.data.samples import get_sample_data
|
|
115
|
+
|
|
116
|
+
data = get_sample_data('tv_xauusd_1h')
|
|
117
|
+
sma = calculate_atr(data, period=14)
|
|
118
|
+
wilder = calculate_atr(data, period=14, method='wilder')
|
|
119
|
+
print(int(sma.isna().sum()), int(wilder.isna().sum()))
|
|
120
|
+
print(round(sma.iloc[-1], 4), round(wilder.iloc[-1], 4))
|
|
121
|
+
# 13 13
|
|
122
|
+
# 7.6679 8.7819
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Уайлдер помнит всю историю: два кадра, начатые с разных баров, дают на одном и том же баре
|
|
126
|
+
разный ATR, тогда как скользящее среднее после `period` баров совпадает.
|
|
127
|
+
|
|
106
128
|
Ничего внешнего здесь не считается — только арифметика по OHLCV. Индикаторы живут в
|
|
107
129
|
[`bquant.indicators`](../indicators/README.md).
|
|
108
130
|
|
|
@@ -76,13 +76,13 @@ grep -nE "Ломает:|\(breaking\)" CHANGELOG.md
|
|
|
76
76
|
|
|
77
77
|
```toml
|
|
78
78
|
# pyproject.toml — так делают действующие потребители
|
|
79
|
-
dependencies = ["bquant>=0.0.
|
|
79
|
+
dependencies = ["bquant>=0.0.23,<0.0.24"]
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Точный пин, а не диапазон. Верхняя граница — следующая патч-версия, потому что ломать может
|
|
83
83
|
именно она.
|
|
84
84
|
|
|
85
|
-
Чего **не** делать: `bquant>=0.0.
|
|
85
|
+
Чего **не** делать: `bquant>=0.0.23` без верхней границы. Это не «получать исправления», это
|
|
86
86
|
«получить смену умолчания в тот день, когда вы о ней не знаете».
|
|
87
87
|
|
|
88
88
|
В дистрибутив входит только пакет `bquant*`; `tests/`, `docs/` и `devref/` в колесо не
|
|
@@ -115,10 +115,10 @@ dependencies = ["bquant>=0.0.22,<0.0.23"]
|
|
|
115
115
|
|
|
116
116
|
| | |
|
|
117
117
|
|---|---|
|
|
118
|
-
| Релизов всего | **
|
|
118
|
+
| Релизов всего | **21** (`0.0.3` … `0.0.23`) |
|
|
119
119
|
| Первый | 2026-07-24 |
|
|
120
120
|
| Последний | 2026-11-04 |
|
|
121
|
-
| По месяцам | 2026-07 — 1, 2026-08 — 6, 2026-09 — **9**, 2026-10 — 2, 2026-11 —
|
|
121
|
+
| По месяцам | 2026-07 — 1, 2026-08 — 6, 2026-09 — **9**, 2026-10 — 2, 2026-11 — 3 |
|
|
122
122
|
|
|
123
123
|
```bash
|
|
124
124
|
git log --grep "^release: bquant" --date=short --pretty="%ad %s"
|
|
@@ -140,7 +140,7 @@ git log --grep "^release: bquant" --date=short --pretty="%ad %s"
|
|
|
140
140
|
молча перенаправляет, есть ровно та форма дефекта, которую проект в себе и чинит.
|
|
141
141
|
* **LTS-веток нет.** Исправление выходит в следующей версии, назад не портируется.
|
|
142
142
|
* **Прогонов на каждый пуш нет, и они не обещаются.** Условие релиза — гейт: чистый клон,
|
|
143
|
-
два плеча `pandas` (свежий 3.x — на 0.0.
|
|
143
|
+
два плеча `pandas` (свежий 3.x — на 0.0.23 это 3.1.0 — и 2.3.3), полный сьют, батарея примеров, контракт архитектуры и
|
|
144
144
|
установочная проверка из нейтрального каталога. Он строже типичного CI, но проходит только
|
|
145
145
|
перед выпуском.
|
|
146
146
|
* **Что есть с 2026-09-12: недельный прогон на свежем разрешении зависимостей**
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bquant"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.23"
|
|
8
8
|
description = "Quantitative research toolkit for financial markets"
|
|
9
9
|
authors = [{name = "kogriv", email = "kogriv@gmail.com"}]
|
|
10
10
|
readme = "README.md"
|