Commit Graph
4 Commits
Author SHA1 Message Date
mika@stocksharp.com 090902335c Correct diagram runtime behavior
WHAT LEAVES A SOCKET. The order element's Matched and Finished sockets are both declared as order
sockets, and both emitted what caused the ending rather than the order itself - a MyTrade and an
OrderFail. Everything wired behind them is entitled to an order; the cancel element casts its input
straight to one, and the cast throws somewhere that names neither the element that emitted nor the
socket it left by. Cancelled had been emitting the order all along, so the two were simply out of
line with their neighbour.

That promise is now checked wherever a diagram test records an output, rather than one element at a
time: a value arriving at the recording element was made when it crossed the link, and the value it
was made from is the one the upstream element emitted, under the socket it emitted from - so the
declared type is there to compare against. Sockets declared as Any promise nothing and are skipped.
Fifty-five elements live here and eighteen are built by a test at all, so this covers what is driven
and leaves the rest where they were.

WHICH PROPERTY A CONVERTER READS. The author picks a property from the socket's type, and it was read
back off the object without that type. A message implements an interface member explicitly, and one
name means different values on different interfaces of the same class, so the value read was not
always the value offered. The read now names the type it was chosen from.

A TRADE COUNTED ONCE. The protection element acted on every trade it was handed, and a trade
re-reported - which is ordinary order flow - protected the same fill twice. Trades are now remembered
per order, by id where the venue gives one and by string id where it gives that instead, and
forgotten on reset so a backtest's second run starts as the first did.

AND A DEBUGGER THAT CAN BE CONTINUED FROM ITS OWN BREAK. The break notification fired before the
object marked itself as waiting, so a handler that continued immediately - the plain way to drive a
debugger - continued something that did not yet consider itself stopped, and the run waited for a
second continue nobody knew to give. The state is set first and the notification follows.
2026-09-14 18:22:25 +03:00
mikasoukhov ff6e2fbcd6 build fix. 2026-02-01 22:31:18 +03:00
mikasoukhov b04f48e0f7 build fix. 2025-12-12 20:09:44 +03:00
mikasoukhov d5813f21c9 Diagram.Core 2025-06-08 18:01:52 +03:00