feat: Enhance trading system with new permanent subscription features and order book management

Changes:
- Added a new API endpoint for managing permanent subscriptions, allowing users to enable or disable subscriptions dynamically.
- Implemented a function to fill candle data from Kiwoom, ensuring that only relevant data is inserted into the database.
- Introduced a mechanism to handle master subscription states, improving the management of subscription statuses.
- Updated the database schema to include new fields for managing subscription states and order book filtering.

Impact:
- These enhancements improve the flexibility and reliability of the trading system, allowing for better management of subscriptions and order book data, while reducing the risk of data inconsistencies.

히스토리 align 제거 븅신같은 초기설계 아예 제거
진입모드에 구멍메움
호가진입을 켜도 호가가 안들어올때 호가 안보고 그냥 사버림
This commit is contained in:
Your Name
2026-08-15 23:01:14 +09:00
parent 4a18ce2697
commit 36a3e2b4a1
94 changed files with 6368 additions and 1639 deletions

View File

@@ -4883,3 +4883,17 @@
{"ts": "2026-08-13T15:27:25+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "114810", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "acf6433c88ee951e", "extra": {"mock": true}}
{"ts": "2026-08-13T15:27:31+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "126340", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "3103f6a9cecadfe9", "extra": {"mock": true}}
{"ts": "2026-08-13T15:27:36+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "264850", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "07f84693aa3df706", "extra": {"mock": true}}
{"ts": "2026-08-14T09:48:05+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "015710", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "2637d49e97a618d6", "extra": {"mock": true}}
{"ts": "2026-08-14T10:31:45+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "475580", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "26d4b62f4dc26aa0", "extra": {"mock": true}}
{"ts": "2026-08-14T10:56:48+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "015710", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "2637d49e97a618d6", "extra": {"mock": true}}
{"ts": "2026-08-14T13:02:21+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "475560", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "1852ca1f54ad6148", "extra": {"mock": true}}
{"ts": "2026-08-14T14:38:55+09:00", "kind": "domestic_order_exception", "strategy_id": "", "side": "BUY", "code": "064820", "msg_cd": "EXC", "msg1": "int() argument must be a string, a bytes-like object or a real number, not 'NoneType'", "rt_cd": "", "http": "", "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "2b38fde42c2410af", "extra": {"mock": true}}
{"ts": "2026-08-14T14:44:33+09:00", "kind": "domestic_order_exception", "strategy_id": "", "side": "BUY", "code": "006730", "msg_cd": "EXC", "msg1": "int() argument must be a string, a bytes-like object or a real number, not 'NoneType'", "rt_cd": "", "http": "", "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "27dfa2f75391e6cc", "extra": {"mock": true}}
{"ts": "2026-08-14T15:27:33+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "010690", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "10ee6c195908c0fd", "extra": {"mock": true}}
{"ts": "2026-08-14T15:27:43+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "101530", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "76a7b781d2a7e341", "extra": {"mock": true}}
{"ts": "2026-08-14T15:27:51+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "005290", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "b87dee0777096a15", "extra": {"mock": true}}
{"ts": "2026-08-14T15:27:59+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "009470", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "20d3d7b93230bbfc", "extra": {"mock": true}}
{"ts": "2026-08-14T15:28:03+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "077360", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "56ac23e698d00448", "extra": {"mock": true}}
{"ts": "2026-08-14T15:28:18+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "094820", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "2a9e0f3fef2c1d06", "extra": {"mock": true}}
{"ts": "2026-08-14T15:29:18+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "009900", "msg_cd": "40240000", "msg1": "모의투자 잔고내역이 없습니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "2259a93fbf5b2c5b", "extra": {"mock": true}}
{"ts": "2026-08-14T15:30:30+09:00", "kind": "domestic_order_reject", "strategy_id": "", "side": "SELL", "code": "009900", "msg_cd": "40580000", "msg1": "모의투자 장종료 입니다.", "rt_cd": "1", "http": 200, "path": "/uapi/domestic-stock/v1/trading/order-cash", "fingerprint": "34352a3219281ecd", "extra": {"mock": true}}

View File

@@ -1 +1 @@
logs/optuna_4strat_tpe_2026-08-07_2026-08-07_20260808_020634_master.log
logs/optuna_4strat_tpe_2026-08-12_2026-08-14_20260815_224827_master.log

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260813_010648.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260814_020952.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260813_010648.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260814_020952.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/logs/optuna_breakout_tpe_20260812_1300_400_20260813_010100.log
logs/optuna_breakout_tpe_20260814_020209.log

View File

@@ -1 +1 @@
breakout_tpe_20260812_1300_400_20260813_010100
breakout_tpe_20260812_20260813_20260814_020209

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_breakout_tpe_20260813_010648.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_tpe_20260815_225502.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_fast_20260812_235406.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_tpe_20260814_115644.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_tpe_20260728_200954.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_momentum_tpe_20260814_115644.json

View File

@@ -1 +1 @@
logs/optuna_momentum_tpe_20260808_020634.log
logs/optuna_momentum_tpe_20260814_015447_resume.log

View File

@@ -1 +1 @@
momentum_tpe_20260807_20260807_20260808_020634
momentum_tpe_20260812_20260813_20260814_014442

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_scalp_fast_20260812_233958.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_scalp_tpe_20260814_021723.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_scalp_tpe_20260728_201954.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_scalp_tpe_20260814_021723.json

View File

@@ -1 +1 @@
logs/optuna_scalp_tpe_20260808_023028.log
logs/optuna_scalp_tpe_20260814_021011.log

View File

@@ -1 +1 @@
scalp_tpe_20260807_20260807_20260808_023028
scalp_tpe_20260812_20260813_20260814_021011

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_fast_20260808_022522.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_tpe_20260815_225502.json

View File

@@ -1 +1 @@
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_tpe_20260728_022918.json
/home/hoon/kis_bot/kis_trader/backtest/results/optuna_tail_tpe_20260815_225502.json

View File

@@ -1 +1 @@
logs/optuna_tail_tpe_20260808_021348.log
logs/optuna_tail_limit_atr_tpe_20260815_225312.log

View File

@@ -1 +1 @@
tail_tpe_20260807_20260807_20260808_021348
tail_limit_atr_tpe_20260812_20260814_20260815_225312

View File

@@ -1 +1 @@
opt_20260812_001757_scal
opt_20260815_224827_seq