Even though the Order Entity already contains commonly used properties like side, quantity, time-in-force, etc. it is possible to attach additional arbitrary properties to an Order. Order properties have a name, a value and a type.
Order properties of type INTERNAL
are kept inside the system and are not propagated to external brokers.
If the type of an Order property is FIX
it is assigned to an outgoing Fix order as an additional fix tag. It is therefore mandatory that the name of the order property is a number (representing the fix tag).
If the type of an Order property is IB
the system will try to find an IB order field corresponding to the IB order property name. In case no matching field is found the order property is added as an AlgoParams)
An internal order property can be attached to an order as follows:
order.addProperty("test", "XYZ", OrderPropertyType.INTERNAL);
An Fix order property can be attached to an order as follows:
order.addProperty("4000", "XYZ", OrderPropertyType.FIX);
An IB order property can be attached to an order as follows:
order.addProperty("faGroup", "group1", OrderPropertyType.IB);
Note
OrderProperties
are only supported on Order Entities but not on Order value objects.
Comments
2 comments
How can these saved additional tags / parameters be read later?
The additional tags are persisted in the algotrader.order_property MySQL table. You can leverage the LookupService and HQL to retrieve the saved values.
Please sign in to leave a comment.