public TradingAgentExecutionHandle createExecution(TradingAgentBindingHandle bindingHandle, ExecutionType type) throws ExecutionCreationException {
TradingAgentBinding binding = retrieveBinding(bindingHandle);
ITradingAgentExecution execution;
ITradingAgent tradingAgent = binding.getConfiguration().newTradingAgent();
if (!isExecutionTypeAvailable(type)) {
throw new ExecutionCreationException(type.name() + " execution service not available");
}
if (type == ExecutionType.LIVE){
execution = new TradingAgentExecution(tradingAgent, liveExecutionService);
} else {
execution = new SimulatedTradingAgentExecution(tradingAgent, simulatedExecutionServiceFactory.createSimulatedExecutionService());