Align Docker support files and commands#22
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| prev_pos = pos.shift(1).fillna(0.0) | ||
| entries = (pos != 0.0) & (pos != prev_pos) | ||
| # shift trade ids so the flip bar's return stays with the trade that held it | ||
| trade_ids = entries.shift(1).cumsum() | ||
| trade_ids = trade_ids.where(pos != 0.0) |
There was a problem hiding this comment.
Trade metrics ignore the closing bar
Trade returns are grouped with trade_ids derived from the current position (entries/pos) while per-bar returns use the previous position (strat_rets = pos.shift(1)…). When a signal turns flat, the return on that final bar still affects equity but is masked out of trade_returns, so per-trade stats under-report results (e.g., signals [1, 1, 0] on prices 100→110→121 yield 21% equity growth but the average trade return reports only 10%). Align the trade-id mask with the shifted position (e.g., use prev_pos or pos.shift(1) when deciding which bars belong to a trade) so closing bars are included in trade metrics.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task