- Move trailing stop BEFORE execute_trade in training kernel (was after,
then undone). Now matches backtest: check → modify target → execute.
Eliminates the wasteful execute-then-undo pattern.
- Trailing stop uses current-bar unrealized (not raw_next forward-looking)
for train/eval consistency
- Add b2_size/b1_size guards to action re-encoding in both kernels
(prevents division by zero if branch sizes are ever 0)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>