Commit Graph

3 Commits

Author SHA1 Message Date
jgrusewski
da91c412ab fix(cli): distinct paper-envelope refuse message + reject negative --paper-envelope (Task 9 review)
Two execute-CLI gaps from the C3 port:

- `execute_multistrat`'s generic `except Exception` caught the ValueError `plan_and_record` raises
  when a paper-envelope is refused (account not paper) and printed it as a connectivity failure
  ("broker error: ... reachable? ... creds/gateway set?") — misleading for a deliberate safety
  refusal. `execute_bybit` had no try/except at all, so the same refusal from `run_bybit_testnet`
  surfaced as a raw traceback. Both commands now catch `ValueError` distinctly, print
  "paper-envelope refused: <msg>", and exit 1 — same exit code and zero orders placed, just an
  honest message.

- `_resolve_paper_envelope` silently fell back to the config default whenever the flag was <= 0.0,
  so `--paper-envelope -5` looked identical to "unset" and hid an operator typo. A negative flag
  now raises `typer.BadParameter` instead of falling through.

Extends test_cli_execute_helpers.py: the negative-envelope rejection, and two new tests (no live
broker — YahooDataProvider/AlpacaBroker faked, run_bybit_testnet faked) proving each command's
refuse path prints the distinct message and never reaches order placement.
2026-07-11 02:15:12 +02:00
jgrusewski
59439bfcd9 feat(cli): execute-bybit command (bybit testnet exec off Dagster, --paper-envelope) 2026-07-11 01:13:44 +02:00
jgrusewski
8e54d6dc1d feat(cli): execute-multistrat --paper-envelope flag + record real exec venue 2026-07-11 00:54:06 +02:00