¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Adding Attributes to Order Object


 

There is no way to add fields to the Order object that travel all the way to IB and back to you. That would be a scary thought from a security point of view.
But depending on what you are trying to achieve, here a couple thoughts:
  • There is the string field that you are free to assign.
  • You can always define your own ExtendedOrder object locally.
For the second option you'd do these steps:
  • Define the extended order class as a wrapper that has your custom fields plus a field that carries the original IB order object
  • Maintain a map (indexed by, say, orderId, permId or orderRef) that remembers the wrapper for each order
  • Define your versions of the order related request methods that transmits only the IB order object
  • Define your versions of the order related callbacks that wrap the IB order objects you receive with the corresponding wrapper you kept in the map
There are not that many order related methods, so that this does not sound like a huge task.

JR

Join [email protected] to automatically receive all group messages.