Files
Trading-Bot/tests/test_wf_visualizer.py
DaM f85c522f22 feat: finalize portfolio system and quantitative validation- Finalized MA_Crossover(30,100) and TrendFiltered_MA(30,100,ADX=15)
- Implemented portfolio engine with risk-based allocation (50/50)
- Added equity-based metrics for system-level evaluation
- Validated portfolio against standalone strategies
- Reduced max drawdown and volatility at system level
- Quantitative decision closed before paper trading phase
2026-02-02 14:38:05 +01:00

41 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# tests/test_wf_visualizer.py
import sys
from pathlib import Path
import pandas as pd
# Añadir raíz del proyecto al path
sys.path.insert(0, str(Path(__file__).parent.parent))
from src.core.visualizers.walk_forward_visualizer import WalkForwardVisualizer
def test_wf_visualizer():
"""
Test del WalkForwardVisualizer usando los CSV existentes
"""
base_path = Path("backtest_results/walkforward")
summary_df = pd.read_csv(base_path / "walkforward_summary.csv")
windows_df = pd.read_csv(base_path / "walkforward_windows.csv")
viz = WalkForwardVisualizer(
summary_df=summary_df,
windows_df=windows_df,
name="BTC/USDT MA + ADX"
)
# 📊 Plots
viz.plot_avg_metrics()
viz.plot_returns_by_window()
viz.plot_drawdown_by_window()
viz.plot_return_distribution()
viz.plot_parameter_stability("fast_period")
viz.plot_parameter_stability("slow_period")
viz.plot_parameter_stability("adx_threshold")
if __name__ == "__main__":
test_wf_visualizer()