3.2 KiB
3.2 KiB
Implementation Log
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".