Repository navigation
What's New
Entry Price Support
- Limit Order Entry Pricing: XGBoost now calculates optimal entry prices for limit orders (1x ATR below current price)
- Market vs Limit Orders: Automatic order type detection based on confidence (≥85% = MARKET, <85% = LIMIT)
- Entry Price Display: New Entry column in signals table showing recommended entry price with discount percentage
- Accurate Allocation: Position sizing and SL/TP calculations now based on entry price, not current price
Display Improvements
- Cleaner Table Layout: Separated SL, TP, Trail, Est Profit, and Est Loss into individual columns
- Full Rupiah Format: Changed Est P/L from confusing millions notation (+0.17M) to full Rupiah (+Rp 170,000)
- Removed Shares Column: Simplified display - allocation amount is more important than share count
- Max Hold Days Reminder: Added configuration display showing 5-day time stop limit
- Better Allocation Summary: Removed hardcoded "(3%)" text, now shows dynamic percentages
Performance Optimizations
- Batch Database Loading: Reduced from ~80 individual queries per day to 1 batch query (10-12x faster)
- Skip Held Positions: No longer rescans stocks already in portfolio during signal scanning
- Faster Backtest: Ensemble backtest now completes in ~5-10 minutes instead of 50+ minutes
Progress Tracking
- Real-time Stats: Replaced misleading time estimates with useful metrics (active positions, closed trades)
- Current Date Display: Shows which date is being processed during backtest
- Accurate Progress: Better visibility into backtest execution state
Technical Details
Modified Files
- `ml/xgb_inference.py`: Added entry_pct calculation (0.0 for MARKET, 1.0x ATR for LIMIT)
- `scripts/signals.py`: Entry price display, separated columns, full Rupiah format, max hold days
- `scripts/eval_ensemble.py`: Batch loading, skip held tickers, real-time progress stats
Configuration
- Max Hold Days: 5 days (from `config.ml.tbl_horizon`)
- Entry Price Logic:
- High confidence (≥85%): Enter at market price
- Moderate confidence (<85%): Enter 1x ATR below current price
Upgrade Notes
All changes are backward compatible. Existing XGBoost models from v2.0.0 will work with this release.
Full Changelog
Entry Price
- Calculate entry price based on order type (MARKET/LIMIT)
- Use entry price for position sizing in signals and backtest
- Display entry price with percentage discount in table
Display
- Separate SL/TP/Trail into individual columns with percentages
- Separate Est Profit/Est Loss into individual columns
- Change format from "+0.17M" to "+Rp 170,000" for Indonesian users
- Remove Shares column for cleaner table
- Add "Max Hold Days: 5 days (time stop)" to configuration display
- Fix allocation summary labels (remove hardcoded "3%")
Performance
- Add `load_all_tickers_batch()` for single-query batch loading
- Filter out already-held tickers in `scan_signals()`
- Optimize database queries with window functions
Progress
- Replace `TimeRemainingColumn` with real-time stats display
- Show "Positions: X | Trades: Y" during backtest
- Show current date being processed
Full Diff: v2.0.0...v2.1.0