The manager already indexes its stops by security for CheckPrice, but the
interface offered no way to read that index, so every caller that needs to walk
the stops of one instrument had to keep a second index of its own over the very
same objects.
GetStopIds hands out the transaction ids resting on a security, copied out under
the same lock every other operation runs under and filtered to the stops that are
still registered, since CheckPrice prunes its per-security list lazily.
Add IPercentStopOrderCondition with three flags (IsActivationPricePercent,
IsClosePositionPricePercent, IsTrailingOffsetPercent) and carry them
through StopOrderCondition / StopOrderInfo.
StopOrderManager:
- percent limit price: resolved at trigger time against the actual
activated stop price (Buy: stop*(1+pct/100), Sell: stop*(1-pct/100))
- percent trailing offset: stop price recomputed each tick from the
high/low watermark (Sell: high*(1-pct/100), Buy: low*(1+pct/100))
Percent activation is resolved by the caller (server side) because it
requires a market-price snapshot that the matcher does not track.
Add StopOrderCondition, IStopOrderManager and StopOrderManager with support
for stop-market, stop-limit and trailing stop orders. Integrate stop order
processing into MarketEmulator (register, cancel, trigger on L1/tick prices).
Add 14 unit tests for StopOrderManager.