I have implemented custom FillType and implemented its main method:
public override void Fill([COLOR="Red"]Order[/COLOR] o)
where I need access to order by IOrder interface (used everywhere across whole API).
What I have in parameter - is just Order class.
My problem now is, that parameter of the method above is Order - instead of IOrder.
I need IOrder, because I store various useful data related to each IOrder, during its lifecycle. For example I store all IExecutions associated with IOrder and many other similar metadata... I store this metadata in simple Map (Dictionary), where key is the IOrder and value is the object with Metadata..
So this is main question:
How can I get the IOrder object in custom FillType - when parameter of its method is only Order object?
I need access to IOrder, to get access to Metadata stored in my Map (Dictionary).
What I tried to resolve this problem - but it is not working:
- I tried to simply cast the parameter to the IOrder, but this fails with exception.
- I tried to store order metadata in map, where key is IOrder#OrderId - so I would not be dependent on the IOrder instance. But this can fail in live trading, because OrderId can change during lifetime of the IOrder - as mentioned in the NT7 documentation for IOrder.
Comment