Skip to content

Paginate order fetches in Live Reconciliation tutorial (#2300)#2304

Merged
AlexCatarino merged 2 commits intoQuantConnect:masterfrom
AlexCatarino:bug-2300-paginate-reconciliation-orders
Apr 15, 2026
Merged

Paginate order fetches in Live Reconciliation tutorial (#2300)#2304
AlexCatarino merged 2 commits intoQuantConnect:masterfrom
AlexCatarino:bug-2300-paginate-reconciliation-orders

Conversation

@AlexCatarino
Copy link
Copy Markdown
Member

Summary

  • `ReadLiveOrders` / `ReadBacktestOrders` (and their Python counterparts) return at most 100 orders per call. The single-window fetch in Plot Order Fills and in 99 Examples silently truncated any project with more than 100 orders (confirmed on a project with 400 backtest orders — only 100 were shown).
  • Replace the retry-on-empty helper with `read_all_orders` / `ReadAllOrders` that:
    • retries the first window while it's empty (initial-load delay), then
    • paginates in 100-Id windows until the endpoint returns an empty window.
  • Applies symmetrically to Python and C# in both 05 Plot Order Fills.php and 99 Examples.html.

Follow-up to #2301 and #2302.

Test plan

  • Run the Python recipe against a project with more than 100 orders (e.g. 400) and confirm every order is returned.
  • Run the C# recipe against the same project and confirm `liveOrders.Count` matches the expected total.
  • Confirm the helper still works on projects with fewer than 100 orders and on newly-deployed live projects that need the loading retry.

…2300)

ReadLiveOrders and ReadBacktestOrders return at most 100 orders per
call, so the single-window fetch on the Plot Order Fills step and in
99 Examples truncated any project with more than 100 orders (confirmed
on a project with 400 backtest orders). Replace the single retry-on-
empty helper with read_all_orders / ReadAllOrders that retries the
first window while it's empty and then paginates in 100-Id windows
until the endpoint returns an empty window.
@AlexCatarino AlexCatarino merged commit ebc0e43 into QuantConnect:master Apr 15, 2026
@AlexCatarino AlexCatarino deleted the bug-2300-paginate-reconciliation-orders branch April 15, 2026 23:13
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