feat: Enhance trading system with new e_min_chg_pct parameter and related logic
Changes: - Introduced the `e_min_chg_pct` parameter to define the minimum price change percentage compared to the previous day's close, enhancing the momentum trading strategy. - Updated various functions and classes to incorporate this new parameter, ensuring it is utilized in both backtesting and live trading scenarios. - Improved documentation and comments to clarify the purpose and usage of the new parameter across the codebase. Impact: - This addition allows for more precise control over trading conditions, potentially increasing the effectiveness of the momentum strategy while maintaining system integrity and performance.
This commit is contained in:
@@ -26,6 +26,8 @@ MIN_PF="${MIN_PF:-0}"
|
||||
# STRATEGIES="momentum tail" bash ...
|
||||
# STRATEGIES="us_momentum momentum" bash ...
|
||||
STRATEGIES="${STRATEGIES:-momentum tail breakout scalp}"
|
||||
# kiwoom|ls — 웹 Optuna 이력소스 / CLI UNIVERSE_HISTORY_SOURCE
|
||||
UNIVERSE_HISTORY_SOURCE="${UNIVERSE_HISTORY_SOURCE:-${BACKTEST_UNIVERSE_HISTORY_SOURCE:-kiwoom}}"
|
||||
PY="${PY:-.venv/bin/python}"
|
||||
TS0="$(date +%Y%m%d_%H%M%S)"
|
||||
MASTER="logs/optuna_4strat_tpe_${START}_${END}_${TS0}_master.log"
|
||||
@@ -34,6 +36,7 @@ MASTER="logs/optuna_4strat_tpe_${START}_${END}_${TS0}_master.log"
|
||||
echo "======== Optuna 4전략 TPE 순차 시작 $(date -Is) ========"
|
||||
echo "START=$START END=$END MODE=$MODE TRIALS=$TRIALS"
|
||||
echo "STRATEGIES=$STRATEGIES"
|
||||
echo "UNIVERSE_HISTORY_SOURCE=$UNIVERSE_HISTORY_SOURCE"
|
||||
echo "min_wr=$MIN_WIN_RATE min_pf=$MIN_PF min_trades=$MIN_TRADES"
|
||||
echo "apply-best=OFF orderbook=off n_jobs=1 (사후 results_gated + briefing.md)"
|
||||
echo "master_log=$MASTER"
|
||||
@@ -55,7 +58,7 @@ run_one() {
|
||||
|
||||
{
|
||||
echo ""
|
||||
echo "-------- [$strat] START $(date -Is) study=$study --------"
|
||||
echo "-------- [$strat] START $(date -Is) study=$study univ=$UNIVERSE_HISTORY_SOURCE --------"
|
||||
} | tee -a "$MASTER"
|
||||
echo "$log" > "logs/optuna_${strat}_tpe_latest.logpath"
|
||||
echo "$study" > "logs/optuna_${strat}_tpe_latest.study"
|
||||
@@ -74,6 +77,7 @@ run_one() {
|
||||
--no-progress \
|
||||
--study-name "$study" \
|
||||
--sort-by "$sort_by" \
|
||||
--universe-history-source "$UNIVERSE_HISTORY_SOURCE" \
|
||||
>"$log" 2>&1
|
||||
local rc=$?
|
||||
set -e
|
||||
|
||||
Reference in New Issue
Block a user