AlgoTraderAlgoTrader Documentation

Chapter 9. Execution Algos

9.1. Development of Execution Algos
9.2. Execution Algos entry form generation

Additional Execution Algos can be added to the system with relatively minimal effort. Execution Algos consist of the following artifacts

The OrderService is aware of all AlgoOrderExecService instances declared in the Spring application context of the server process. Custom AlgoOrderExecService implementations also get automatically recognized as long as they are declared in the same application context. The OrderService delegates handling of individual orders to their respective algo service based on the order type. It is important for classes implementing AlgoOrderExecService to correctly implement its #getAlgoOrderType method.

The AlgoTrader UI can generate the entry form for Execution Algo automatically. To enable it one needs to register the AlgoOrderVO class in the MetaDataRestController and annotate it with @AlgoOrderMetaData. One needs to provide a mapping to the OrderType enum value there. These two steps will allow the UI to generate the entry form for that Execution Algo which will then be available in Advanced Order Form modal.

The Algo Order UI generation can be further tuned by annotating fields inside the AlgoOrderVO class with following annotations:

Below code snipped shows an example for a BigDecimal field named fieldA. This field controls the visibility of fieldB and fieldC. fieldB is only visible if the value of fieldA is true and fieldC is only visible if the value of fieldA is false.

@UIGeneration(toggle = @FieldToggle(visibleOnTrue = "fieldB", visibleOnFalse = "fieldC"))

private BigDecimal fieldA;
@UIGeneration()
private BigDecimal fieldB;
@UIGeneration()
private BigDecimal fieldC;