#!/bin/bash # Walk-forward IchimokuHyper : pour chaque fold, hyperopt sur train -> backtest OOS sur test. set -eo pipefail cd /Users/jerem/Documents/projects/perso/MidasBot CFG=/freqtrade/user_data/config_ich.json DC="docker compose run --rm --no-deps freqtrade" # Paires train|test (train 6 mois glissant, test 2 mois OOS), 2024-06 -> 2026-06 FOLDS=( "20240601-20241201|20241201-20250201" "20240801-20250201|20250201-20250401" "20241001-20250401|20250401-20250601" "20241201-20250601|20250601-20250801" "20250201-20250801|20250801-20251001" "20250401-20251001|20251001-20251201" "20250601-20251201|20251201-20260201" "20250801-20260201|20260201-20260401" "20251001-20260401|20260401-20260623" ) echo "FOLD | TEST_PERIOD | OOS_GAIN%" for f in "${FOLDS[@]}"; do tr="${f%%|*}"; te="${f##*|}" $DC hyperopt --config $CFG --strategy IchimokuHyper \ --hyperopt-loss ProfitDrawDownHyperOptLoss --spaces buy roi stoploss trailing \ --timeframe 1h --timerange "$tr" --epochs 80 -j 4 > /tmp/wf_ho.log 2>&1 g=$($DC backtesting --config $CFG --strategy IchimokuHyper \ --timeframe 1h --timerange "$te" 2>&1 \ | grep -iE 'Total profit %' | head -1 | grep -oE '[-0-9.]+%' | head -1) echo "$tr | $te | $g" done echo "WALKFORWARD_DONE"