mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-28 07:57:44 +00:00
b0490c5f0d
- monte_carlo_trade_pvalue(): shuffles trade P&L N times, returns fraction of permuted sequences that beat real total return (p<0.05 = genuine edge) - walk_forward_rolling(): multiple IS/OOS windows (IS=3yr, OOS=1yr, step=1yr), computes wf_oos_sharpe_mean, wf_oos_consistency (% profitable windows) - backtest_signal_riskmgmt(): new wf_rolling and mc_n_permutations params - Strategy generator: enables both (200 MC permutations), adds mc_ok and wf_ok to acceptance filter (mc_p<0.20, wf_consistency>=50%) - Rebacktest script: enables both, stores all wf_*/mc_* fields in write-back - 6 new tests covering MC pvalue, disabled-by-default, zero-trades edge case, rolling WF key presence and consistency range Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
"""Predix Backtesting Package"""
|
|
from .backtest_engine import BacktestMetrics, FactorBacktester
|
|
from .results_db import ResultsDatabase
|
|
from .risk_management import CorrelationAnalyzer, PortfolioOptimizer, AdvancedRiskManager
|
|
from .vbt_backtest import (
|
|
DEFAULT_BARS_PER_YEAR,
|
|
DEFAULT_TXN_COST_BPS,
|
|
FTMO_INITIAL_CAPITAL,
|
|
FTMO_MAX_DAILY_LOSS,
|
|
FTMO_MAX_TOTAL_LOSS,
|
|
FTMO_MAX_LEVERAGE,
|
|
FTMO_RISK_PER_TRADE,
|
|
OOS_START_DEFAULT,
|
|
WF_IS_YEARS,
|
|
WF_OOS_YEARS,
|
|
WF_STEP_YEARS,
|
|
backtest_from_forward_returns,
|
|
backtest_signal,
|
|
backtest_signal_ftmo,
|
|
monte_carlo_trade_pvalue,
|
|
walk_forward_rolling,
|
|
)
|
|
|
|
__all__ = [
|
|
'BacktestMetrics', 'FactorBacktester', 'ResultsDatabase',
|
|
'CorrelationAnalyzer', 'PortfolioOptimizer', 'AdvancedRiskManager',
|
|
'backtest_signal', 'backtest_signal_ftmo', 'backtest_from_forward_returns',
|
|
'monte_carlo_trade_pvalue', 'walk_forward_rolling',
|
|
'DEFAULT_BARS_PER_YEAR', 'DEFAULT_TXN_COST_BPS',
|
|
'FTMO_INITIAL_CAPITAL', 'FTMO_MAX_DAILY_LOSS', 'FTMO_MAX_TOTAL_LOSS',
|
|
'FTMO_MAX_LEVERAGE', 'FTMO_RISK_PER_TRADE', 'OOS_START_DEFAULT',
|
|
'WF_IS_YEARS', 'WF_OOS_YEARS', 'WF_STEP_YEARS',
|
|
]
|