| Add `custom_signal()` for arbitrary DataFrame-based entry/exit signals (#166) * Initial plan * Add custom_signal() for arbitrary DataFrame-based entry/exit signals Co-authored-by: michaelchu <540510+michaelchu@users.noreply.github.com> * fix: harden custom_signal with input validation, NaN handling, and vectorized lookup - Validate required columns at construction time with clear ValueError - Treat NaN in flag column as False instead of silently coercing to True - Replace O(n) Python list comprehension with vectorized MultiIndex.isin() - Add tests for NaN handling and missing column error paths - Allow copilot/ branch prefix in pre-push hook and CLAUDE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add build_custom_signal tool for arbitrary pandas/numpy signal code (#169) Allow users to define custom entry/exit signals by writing pandas/numpy code that computes a boolean Series from OHLCV data. Code runs in a restricted exec() sandbox (no import/open/eval) per symbol group, with results intersected against options dates and stored as a signal slot. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: harden build_custom_signal handler - Hoist _SAFE_BUILTINS to module level (avoid rebuilding per call) - Validate signal Series length matches DataFrame length - Use `is None` instead of `or` to avoid pandas Series truthiness error - Support partial success: if code fails for some symbols but succeeds for others, return results with a warning instead of failing entirely Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: michaelchu <540510+michaelchu@users.noreply.github.com> Co-authored-by: Michael Chu <mchchu88@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> | 6 个月前 |