feat: Enhance Optuna integration and logging for backtesting framework

Changes:
- Added new API endpoints for continuing and confirming Optuna jobs, allowing for better management of ongoing studies.
- Introduced detailed logging for tick feed tracking and order book processing, improving traceability of vendor performance during backtests.
- Updated database schema to include new fields for managing Optuna study results, enhancing the ability to track study progress and outcomes.
- Refactored existing functions to utilize the new logging and tracking features, ensuring consistency across the backtesting framework.

Impact:
- These enhancements improve the robustness and transparency of the Optuna backtesting process, facilitating better analysis and optimization of trading strategies.
This commit is contained in:
Your Name
2026-08-21 19:05:23 +09:00
parent 0ecac7cb95
commit 0780b2cdd0
76 changed files with 4648 additions and 516 deletions

View File

@@ -5076,3 +5076,7 @@
{"ts": "2026-08-18T15:30:05+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "009520", "msg_cd": "40580000", "msg1": "모의투자 장종료 입니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "f34b1e0fbbfb6b4e", "extra": {"mock": true}}
{"ts": "2026-08-18T15:30:20+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "033160", "msg_cd": "40580000", "msg1": "모의투자 장종료 입니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "9a68dfa02029dda4", "extra": {"mock": true}}
{"ts": "2026-08-19T12:43:01+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "038680", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "d64a4218f5f98f5e", "extra": {"mock": true}}
{"ts": "2026-08-21T15:31:43+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "490470", "msg_cd": "40580000", "msg1": "모의투자 장종료 입니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "eee3d14e7e1a9629", "extra": {"mock": true}}
{"ts": "2026-08-21T15:40:02+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "490470", "msg_cd": "40580000", "msg1": "모의투자 장종료 입니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "eee3d14e7e1a9629", "extra": {"mock": true}}
{"ts": "2026-08-21T15:47:18+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "490470", "msg_cd": "40580000", "msg1": "모의투자 장종료 입니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "eee3d14e7e1a9629", "extra": {"mock": true}}
{"ts": "2026-08-21T15:55:43+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "490470", "msg_cd": "40580000", "msg1": "모의투자 장종료 입니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "eee3d14e7e1a9629", "extra": {"mock": true}}

View File

@@ -0,0 +1,5 @@
strategy=scalp
study=scalp_tpe_20260818_20260820_20260821_120156
entry_mode=
sl_mode=
extra=

View File

@@ -1 +1 @@
logs/optuna_4strat_tpe_2026-08-17_2026-08-19_20260819_092648_master.log
logs/optuna_4strat_tpe_2026-08-18_2026-08-20_20260821_102454_master.log

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260819_092934.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260821_120015.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260819_092934.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260821_120015.json

View File

@@ -1 +1 @@
logs/optuna_breakout_atr_tpe_20260819_092820.log
logs/optuna_breakout_atr_tpe_20260821_114820.log

View File

@@ -1 +1 @@
breakout_atr_tpe_20260817_20260819_20260819_092820
breakout_atr_tpe_20260818_20260820_20260821_114820

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260819_092934.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_tpe_20260821_151059.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_tpe_20260816_031742.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_tpe_20260821_151059.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_tpe_20260816_031742.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_tpe_20260821_151059.json

View File

@@ -1 +1 @@
logs/optuna_momentum_tpe_20260816_025631.log
logs/optuna_momentum_tpe_20260821_102454.log

View File

@@ -1 +1 @@
momentum_tpe_20260812_20260814_20260816_025631
momentum_tpe_20260818_20260820_20260821_102454

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_scalp_tpe_20260819_025229.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_scalp_tpe_20260821_122053.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_scalp_tpe_20260819_025229.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_scalp_tpe_20260821_122053.json

View File

@@ -1 +1 @@
logs/optuna_scalp_tpe_20260816_043425.log
logs/optuna_scalp_tpe_20260821_120156.log

View File

@@ -1 +1 @@
scalp_tpe_20260812_20260814_20260816_043425
scalp_tpe_20260818_20260820_20260821_120156

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_tpe_20260816_040252.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_tpe_20260821_113102.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_tpe_20260816_040252.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_tpe_20260821_113102.json

View File

@@ -1 +1 @@
logs/optuna_tail_limit_atr_tpe_20260816_035149.log
logs/optuna_tail_limit_atr_tpe_20260821_111542.log

View File

@@ -1 +1 @@
tail_limit_atr_tpe_20260812_20260814_20260816_035149
tail_limit_atr_tpe_20260818_20260820_20260821_111542

View File

@@ -1 +1 @@
opt_20260819_092648_seq
opt_20260821_145331_mome