5.6 KiB
5.6 KiB
Implementation Log
2026-05-28
- Applied the approved 2026-05-28 strategy update:
ENTRY_STARTchanged from"09:15"to"09:20".FORCE_EXIT = "14:50"was verified unchanged.
- Fixed the
avoid_sectorsruntime bug:app/main.pynow passessectorintoVolatilityBreakout.check_entry().- Added
ticker_sectorscache support from ranking rows when sector fields exist. - Added conservative name-based avoid-sector hints for cases such as construction names when no sector field is available.
- Repaired the external-data pretraining path:
scripts/collect_daily_features.pynow falls back to KIS daily OHLCV when pykrx fails.scripts/collect_minute_data.pyexcludes ETF/ETN by default and collects multiple intraday windows from 09:30 to 14:00.scripts/build_external_training_dataset.pynow uses prior daily OHLCV rows for breakout targets instead of same-day OHLCV.scripts/run_training_pipeline.ps1builds external rows with--all-minutesfor pretraining.
- Removed model leakage:
- Excluded future/outcome columns from training features:
price_*,ret_*,mfe_*,mae_*,pnl, andexit_price.
- Excluded future/outcome columns from training features:
- Fixed PowerShell training pipeline execution:
- Replaced
$Argsparameter usage with$StepArgsto avoid PowerShell automatic-variable collision. - Prevented nonzero stderr output from stopping required exit-code handling.
- Normalized Python step logging to UTF-8 append.
- Replaced
- Removed unused helper:
scripts/_send_midday_discord.py.
Validation performed:
python -m compileall app scriptspassed.- Manual external daily collection passed through KIS fallback.
- Manual KIS minute collection saved 11 regular-stock CSV files for 2026-05-28.
data/external_training_dataset.csvgenerated 3,146 rows.data/training_dataset.csvgenerated 10 bot-trade rows.python scripts/train_ai_model.pygeneratedmodels/scalping_model.jobliband metrics.powershell -ExecutionPolicy Bypass -File scripts\run_training_pipeline.ps1passed end-to-end.
Latest training metrics:
label_stop_loss: rows 3,156, accuracy 0.750, precision 0.450, ROC-AUC 0.851.label_win: rows 3,156, accuracy 0.635, precision 0.492, ROC-AUC 0.719.
Open risks:
- AI remains observation-only and must not block entries, resize trades, or override exits.
- Training is still dominated by external pretraining rows; actual bot-labeled rows are only 10.
- Same-day pykrx data may fail; KIS fallback is active but index rows can be empty.
- Real-cash trading remains unapproved.
2026-05-27
- Reviewed the stock scalping bot structure and moved it toward an AI-training-ready paper-trading platform.
- Added database tables for AI training:
entry_snapshotspost_entry_snapshots
- Added entry-time data capture after successful buys.
- Added post-entry sampling at 60s, 180s, 300s, and 600s.
- Fixed partial-exit accounting so partial TP1 exits no longer close the whole trade row.
- Relaxed strict entry-limit enforcement during paper-trading data collection while preserving warning logs.
- Added daily/export training scripts:
scripts/export_training_dataset.pyscripts/collect_daily_features.pyscripts/collect_minute_data.pyscripts/build_external_training_dataset.py
- Added ML training and runtime support:
app/ml/features.pyapp/ml/predictor.pyscripts/train_ai_model.py
- Added observation-only AI scoring:
- Runtime scores are recorded only when a trained model exists.
- AI scores do not block entries, change sizing, or override exits.
- Added daily training pipeline:
scripts/run_training_pipeline.ps1
- Registered and verified Windows Scheduler tasks:
StockBot_MorningStockBot_WatchdogStockBot_MiddayStockBot_EveningStockBot_Training
- Rewrote scheduler setup to avoid hardcoded broken Korean paths:
scripts/setup_scheduler.ps1
- Rewrote watchdog wrapper with trading-day and time-window checks:
scripts/run_watchdog.ps1
- Added dependency portability:
- Root
requirements.txt scripts/install_dependencies.ps1scripts/download_dependencies.ps1vendor/wheelswheelhouse for Windows/Python 3.11
- Root
- Updated operational docs:
README.mdCLAUDE.mdreports/daily/2026-05-27.md
Validation performed:
- Python compile check passed.
- DB migration checked.
- AI score snapshot insert checked with a temporary DB.
- Training script checked with empty dataset.
- Scheduler registration checked.
- PowerShell script parse check passed.
Open risks:
- KIS minute endpoint still needs live response verification.
- Early model quality is expected to be weak until enough labeled rows exist.
- External minute data is useful for pretraining, not final bot-trade truth.
- Real-cash trading still needs stronger fill, partial-fill, unfilled-order, cancel/replace, and recovery handling.
- Raspberry Pi dependency packaging needs a Linux/ARM-specific setup.
- Approved and applied
ENTRY_START = "09:15"after the 2026-05-27 evening review. - Reason: 09:05-09:06 generated four immediate SL trades and most of the daily loss.
- Time-based sizing and time-based SL changes remain deferred.
2026-05-27 Strategy Approval Log
- User approved Claude Evening Proposal 1.
- Changed
app/config.py:- Before:
ENTRY_START = "09:05" - After:
ENTRY_START = "09:15"
- Before:
- Rationale:
- Four immediate SL trades occurred from 09:05:03 to 09:05:49.
- Those four trades lost about
-183,969 KRW. - This represented about 74.5% of the daily loss.
- Deferred:
- Time-based position-size reduction.
- Time-based stop-loss adjustment.
- Verification:
- Python compile check passed.
- Runtime import confirmed
ENTRY_START == "09:15".