Files
mika@stocksharp.com 735a0e701c Book each maker of an internal cross for what was taken from it
The volume a resting order gave up was computed while consuming it and then thrown
away: the book returned only the orders a level had held, and the adapter worked the
traded volume out afterwards from a balance the consumption had already decremented.
A maker eaten down to its last lot was therefore booked a trade of zero volume, its
position never moved, and downstream the inventory book stayed skewed by the whole
amount for good, because a zero-volume trade is dropped. Orders sitting at a touched
level that the match never reached were booked a phantom trade for the same reason.

The consumed volume now leaves the match with the fill that produced it: ConsumeVolume
yields a MatchFill per resting order - which order, how much of it was taken, what was
left - and MatchTrade.CounterOrders becomes CounterFills. Each maker is booked exactly
what the taker took from it, and an order the match never reached raises nothing.
2026-08-22 09:45:25 +03:00

10 lines
481 B
C#

namespace StockSharp.MatchingEngine;
/// <summary>
/// Volume one match took from a single resting order.
/// </summary>
/// <param name="Order">Resting order the volume was taken from.</param>
/// <param name="Volume">Volume taken from <paramref name="Order"/> by this match.</param>
/// <param name="Remaining">Volume left of <paramref name="Order"/> right after this match took its part.</param>
public record MatchFill(EmulatorOrder Order, decimal Volume, decimal Remaining);