Add dry-run Firstrade strategy runtime#2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24df5a0647
ℹ️ 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".
| continue | ||
|
|
||
| for symbol, delta_value, price in [item for item in tradable_deltas if item[1] > 0]: | ||
| buy_budget = min(float(delta_value), investable_cash, order_notional_cap) |
There was a problem hiding this comment.
Add sell proceeds to investable cash before buy planning
execute_value_target_plan sells first but never credits sell proceeds back into investable_cash; buy sizing is computed from the pre-sell cash at this line and only reduced after buys. In rotations where starting cash is low and buys depend on same-cycle sells, the buy leg is skipped as buy_quantity_zero, leaving the portfolio unintentionally underinvested even though sells were submitted.
Useful? React with 👍 / 👎.
| if "benchmark_history" in available_inputs: | ||
| inputs["benchmark_history"] = _build_price_history(market_data_port, benchmark_symbol) | ||
| if "qqq_history" in available_inputs: | ||
| inputs["qqq_history"] = _build_price_history(market_data_port, benchmark_symbol) |
There was a problem hiding this comment.
Populate qqq_history from QQQ instead of benchmark symbol
build_market_inputs currently fills qqq_history from benchmark_symbol. Since benchmark_history is already populated separately, any profile that overrides benchmark_symbol (for example to SPY) will silently receive the wrong instrument for qqq_history, which can alter strategy signals and resulting allocations.
Useful? React with 👍 / 👎.
Summary
Tests