Skip to content

Remove default Firstrade order notional cap#17

Merged
Pigbibi merged 1 commit into
mainfrom
codex/firstrade-unlimited-notional
May 24, 2026
Merged

Remove default Firstrade order notional cap#17
Pigbibi merged 1 commit into
mainfrom
codex/firstrade-unlimited-notional

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make FIRSTRADE_MAX_ORDER_NOTIONAL_USD optional instead of defaulting to 25 USD
  • preserve explicit cap behavior when the variable or CLI flag is set
  • persist live no-action strategy runs as NO_ACTION so they do not block a later monthly rerun

Tests

  • .venv/bin/python -m pytest -q
  • .venv/bin/python -m py_compile application/firstrade_client.py application/execution_service.py application/runtime_broker_adapters.py application/rebalance_service.py runtime_config_support.py scripts/firstrade_smoke_check.py tests/test_firstrade_client.py tests/test_execution_service.py tests/test_rebalance_service.py

@Pigbibi Pigbibi merged commit 3a208bf into main May 24, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/firstrade-unlimited-notional branch May 24, 2026 08:43

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

max_notional_usd=max_order_notional_usd,

P1 Badge Use normalized cap when submitting strategy orders

Here max_order_notional_usd is forwarded directly even when it was already normalized to None for non-positive values (order_notional_cap at lines 243-246). If an existing deployment has FIRSTRADE_MAX_ORDER_NOTIONAL_USD=0, the planner now treats it as uncapped and generates orders, but this raw 0 is passed downstream and validate_stock_order rejects it (max_notional_usd must be positive), causing the whole strategy cycle to fail instead of executing. Pass the normalized cap (order_notional_cap) or otherwise coerce non-positive values to None before building the order 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".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant