mirror of
https://github.com/artemium428/428-backtester.git
synced 2026-09-15 18:36:20 +00:00
Ship SampleStrategy and Integral workflow scripts without proprietary V15 logic, Pine, or run results. Co-authored-by: Cursor <cursoragent@cursor.com>
38 lines
976 B
Bash
Executable file
38 lines
976 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
# shellcheck disable=SC1091
|
|
source "$(dirname "$0")/_env.sh"
|
|
|
|
# In-sample range for hyperopt; use a later TIMERANGE for OOS backtest.
|
|
# --analyze-per-epoch is required when buy/sell params change populate_indicators
|
|
# (not only entry/exit columns). Set ANALYZE_PER_EPOCH=0 to disable.
|
|
TIMERANGE="${TIMERANGE:-20240701-20260101}"
|
|
STRATEGY="${STRATEGY:-SampleStrategy}"
|
|
EPOCHS="${EPOCHS:-100}"
|
|
SPACES="${SPACES:-buy sell}"
|
|
LOSS="${LOSS:-SharpeHyperOptLossDaily}"
|
|
JOBS="${JOBS:-}"
|
|
ANALYZE_PER_EPOCH="${ANALYZE_PER_EPOCH:-1}"
|
|
|
|
# shellcheck disable=SC2206
|
|
SPACES_ARR=(${SPACES})
|
|
|
|
ARGS=(
|
|
--config user_data/config.json
|
|
--strategy "${STRATEGY}"
|
|
--timeframe 15m
|
|
--timerange "${TIMERANGE}"
|
|
--spaces "${SPACES_ARR[@]}"
|
|
--hyperopt-loss "${LOSS}"
|
|
-e "${EPOCHS}"
|
|
)
|
|
|
|
if [[ "${ANALYZE_PER_EPOCH}" != "0" ]]; then
|
|
ARGS+=(--analyze-per-epoch)
|
|
fi
|
|
|
|
if [[ -n "${JOBS}" ]]; then
|
|
ARGS+=(-j "${JOBS}")
|
|
fi
|
|
|
|
freqtrade hyperopt "${ARGS[@]}" "$@"
|