I am trying to design my first trading system and I am struggling with designing a correct Order object with all the FIX
concepts involved in it. Wondering if any experienced folks can chime in on some ideas.
I created a simple Order class.
But as a NewOrderSingle
(FIX) is generated, I need a ClOrdId
.
Then when I cancel this order, I need a new ClOrdId
(For every cancel and replace FIX message generated) and set the correct OrigClOrdId
. So I need to keep track of those OrigClOrdIds
.
Also, I think I need to keep a unique Id internal to my system to identify this order, different from ClOrdId
, which could keep changing.
I don't see any nice object oriented way of designing this order object while keeping the concept of various Ids relevant to my FIX messages separate.
How do people design these in real world? Any suggestions? Thanks.