AlgoTrader uses DefaultExecutionModel in simulated trading to decide if placed orders can be executed based on incoming market data events. Default Execution Model is used in backtesting and simulated trading based on live market data.
More details on DefaultExecutionModel in AlgoTrader can be found here:
https://doc.algotrader.com/html_single/index.html#Exchange_Simulator
In some cases, it's needed to adjust DEM to client specific needs, for example, AlgoTrader, when backtesting with bars, uses bar close price as an execution price. In some cases, it might be needed to use a different field for that or implement more sophisticated execution logic.
DefaultExecutionModel can be overridden in any AlgoTrader strategy. In order to do that it's needed to register custom Execution Model as a Spring Bean in the following locations:
-
For simulation:
/META-INF/applicationContext-client-xxx.xml
in the strategy project undersrc/main/resources
. -
For live trading (to be used globally):
/META-INF/applicationContext-env.xml
. This file needs to be in the classpath, e.g. in theconf
project undersrc/main/resources
.
The following steps allow configuration of custom Execution Model in strategy for simulation purposes:
1. Create folder structure for Execution Model:
Custom Execution Model must implement the interface ExecutionModel
.
2. Create applicationContext-client-xxx.xml
file where NewExecutionModel will be registered:
3. Register NewExecutionModel in applicationContext file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="newExecutionModel" class="ch.algotrader.strategy.ema.NewExecutionModel" autowire="byName"/>
</beans>
After that, the simulation will use the newly created Execution Model. You can contact our support team creating a Zendesk request to get details on DefaultExecutionModel implementation in your AlgoTrader version:
https://algotrader.zendesk.com/hc/en-us/requests/new
Comments
0 comments
Please sign in to leave a comment.