For what its worth, there was a request for my TransactionSet code at the SmartQuant Forums. This is my description of the code:
I don't really use the ClOrdId per-se for anything other than reporting an order number. Instead a I created a series of transaction objects, with
each storing an opening market/limit order and a starting stop order. When I need to exit, the transaction object then takes care of closing out any
stops/markets/limits that are still outstanding. I can then calculate profit/loss (which I could have used from already existing QD API elementes),
but I go one step further and maintain other statistics such as time-to-fill, time-in-trade, ... More than anything, the transaction object has
helped simplify/encapsulate the trading state-machine for tracking unfilled limits and stops. And it does it smoothly by making use of the two
events I mentioned earlier. Then from a higher level perspective, on a market direction change, I can simply tell the transaction to 'exit' and it
does what ever clean up is necessary
The code is located in the file TransactionSet.cs.