Skip to content

Conversation

@felipeimpieri
Copy link
Owner

Summary

  • add a screener page fed from the watchlist that computes multi-horizon returns, RSI, SMA distances, and trend labels
  • enable cached daily downloads with sortable rows and per-ticker Open in Home shortcuts

Testing

  • python -m py_compile pages/04_Screener.py

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +109 to +113
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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Drop exit-bar returns when closing to flat

run_backtest groups trade P&L using entries.shift(1).cumsum() and then discards bars where pos is 0 (trade_ids = trade_ids.where(pos != 0.0)). Any time a position is closed to flat, the last bar’s return is still calculated using pos.shift(1) but is filtered out, so that trade’s P&L and win/loss status exclude the exit move. For example signals [1,1,0,0,1,1,0] yield trade returns of about +1.0% and +0.96% instead of ~+1.99% and ~0% because the returns on the bars where the position was exited are dropped. This understates losses and overstates win rate/average trade return for any strategy that ever goes flat.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant