AlgoTraderAlgoTrader Documentation

Chapter 12. Risk Management

12.1. Pre-Trade Checks

Using the provided functionality of the system, the following risk metrics can be enforced by AlgoTrader based strategies:

Note

Enforcing these rules requires coding and is not available through configuration only.

AlgoTrader offers a mechanism to inject arbitrary pre-trade checks. These pre-trade checks can for example reject orders in case of violations of:

To implement pre-trade checks the following steps are needed:

public interface OrderValidator {

    void validateOrder(Order order) throws OrderValidationException;
}

When AlgoTrader is started, all OrderValidator implementations are injected into the OrderService. Every time an Order is sent or modified (not on cancel) and one of the OrderValidators throws an exception, the Order will be rejected and will not go out to the broker or exchange.