Skip to content

fix(orders): refuse incomplete orders before the dry run - #8

Merged
mr-karan merged 1 commit into
zerodha:mainfrom
azeeb:fix/orders-dry-run-validation
Nov 16, 2026
Merged

mr-karan merged 1 commit into
zerodha:mainfrom
azeeb:fix/orders-dry-run-validation

Conversation

@azeeb

@azeeb azeeb commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

kite orders place printed a dry run and exited 0 for orders that are incomplete as written. The TUI order ticket already refuses these; this brings the CLI in line.

Now refused (exit 2, clap usage errors)

  • LIMIT or SL without --price; SL or SL-M without --trigger-price
  • --variety iceberg without --iceberg-legs
  • --variety auction without --auction-number
  • --validity TTL without --validity-ttl
  • zero or negative --quantity (place and modify), negative --disclosed-quantity

Now refused (exit 1, cross-flag checks)

  • LIMIT/SL with --price 0; SL/SL-M with --trigger-price 0
  • --validity-ttl without --validity TTL
  • --iceberg-legs / --iceberg-quantity without --variety iceberg

Not changed

  • MARKET orders may still carry --price, as the help text allows.
  • No lot-size or tick-size checks: they need the instrument cache, and dry runs currently work offline.

Notes

  • mixed_case_order_flags_send_canonical_values placed a LIMIT order with no price, so it now passes --price 1500.
  • Not confirmed how the Kite API responds to these orders; this is a parity fix with the TUI ticket.

To reproduce on main:
kite orders place --exchange NFO --tradingsymbol NIFTY26NOVFUT --transaction-type BUY --product NRML --order-type SL --quantity 75

Fixes #9

@mr-karan
mr-karan force-pushed the fix/orders-dry-run-validation branch from 442eb9d to 67f7bf6 Compare November 16, 2026 06:53
@mr-karan
mr-karan merged commit fb86a86 into zerodha:main Nov 16, 2026
3 checks passed
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.

Orders place: dry run accepts orders that are incomplete as written

2 participants