The Strategy Engine is a client application in the Marketcetera Automated Trading Platform. The Strategy Engine is responsible for the execution of modules, particularly strategies. Strategy Engines connect to an instance of DARE, the Marketcetera order routing engine and provide a web services API for control of the running modules. Multiple Strategy Engines can run at the same time, connected to the same routing engine. By default, the Strategy Engine connects to the Marketcetera cloud DARE instance. You can use this setup to test your strategies before licensing a DARE appliance for your data center or cloud installation.

The Strategy Engine is a command-line application with no UI. The Strategy Engine is considered to be a client application in the Marketcetera Automated Trading Platform in that it needs to connect to an instance of DARE to run.

Running Strategy Engine


The Strategy Engine installs a Start Menu entry. This starts the Strategy Engine with the commands located in src/commands.txt. You can modify that file to change how the Strategy Engine starts by default. Or, you may open a cmd prompt and start the Strategy Engine directly.

Copyright (c) 2006-2014 Marketcetera, Inc.
Strategy Engine version '2.4.0' (build 'cc.build.506')


$ bin/strategyengine.sh 
Copyright (c) 2006-2014 Marketcetera, Inc.
Strategy Engine version '2.4.0' (build 'cc.build.506')

The Strategy Engine can be run, as shown above, with no command-line arguments. In this state, no modules are running yet, the Strategy Engine is an empty container waiting for instruction. The Strategy Engine can be controlled via its web services interface (this is how Photon controls strategies).

Strategy Engine Command Files

You may start the Strategy Engine with a command file as a command-line argument. This tells the Strategy Engine to execute the commands in the file upon start. Sample commands are included with the Strategy Engine in the samples subdirectory.

colin@demeter:~/marketcetera/marketcetera-2.4.0/strategyengine$ bin/strategyengine.sh samples/java/commands/MarketData.txt 
Copyright (c) 2006-2014 Marketcetera, Inc.
Strategy Engine version '2.4.0' (build 'cc.build.506')
Running command 'createModule' with parameters 'metc:strategy:system;marketData,MarketData,JAVA,samples/java/scripts/MarketData.java,,false,metc:sink:system'...
Completed command 'createModule' with result 'metc:strategy:system:marketData'.
Running command 'startModule' with parameters 'metc:mdata:bogus:single'...
Completed command 'startModule' with result 'true'.
Running command 'startModule' with parameters 'metc:strategy:system:marketData'...
Completed command 'startModule' with result 'true'.
Data Flow ID '1' generated data 'of type org.marketcetera.event.impl.LogEventImpl and' value '20140103T171145466Z WARN event Bid Equity Bid(ADD-16 UNKNOWN) for Equity[symbol=GOOG]: 51.95 8004 Equity[symbol=GOOG] BGS1 at 20140103T171144828Z'
Data Flow ID '1' generated data 'of type org.marketcetera.event.impl.LogEventImpl and' value '20140103T171145468Z WARN event Ask Equity Ask(ADD-50 UNKNOWN) for Equity[symbol=GOOG]: 51.96 8177 Equity[symbol=GOOG] BGS1 at 20140103T171145424Z'


The unit of work of the Strategy Engine is the module. Modules are discrete units of code that can participate in data flows. Data flows are managed by the Strategy Engine and route data between two modules.

Every module has a unique identifier, called a URN (Uniform Resource Name). The module URN is used to indicate the target of module commands. 

Data Flows

A data flow is a stream of objects of arbitrary type between two started modules. A data flow must be initiated, either by a command file or from code. Data flows can also be stopped.

Part of the definition of a module is whether it's a data requester, a data receiver, a data flow requester, or all of the above.



Creates a module instance. Some modules are auto-created, some are not; this is defined when the code for the module is written. Modules that are auto-created do not need to be created as they will be created at system initialization. Whether the module is auto-created or created manually, a module must be created before it can be started.


The syntax for the createModule command is particular to the module being started. Here is the current list of modules and their parameters.


Starts a created module instance. Some modules are auto-started, some are not; this is defined when the code for the module is written. Modules that are auto-started can not be manually started. Modules that are not auto-started must be started before they can participate in a data flow.


The syntax for the startModule command is: startModule;<Module Instance URN>


Creates a data flow between module instances. The source module must be a DataEmitter and the target module must be a DataReceiver.


The syntax for the createDataFlow command is: createDataFlow;<Module Instance URN>;<content>^<Module Instance URN>;<content>^...^<Module Instance URN>. This implies that several different modules can participate in the same data flow. If a module has entries to its left, that module must be a DataReceiver. If a module has entries to its right, that modules must be a DataEmitter. In the example above, then, the module with the URN "metc:strategy:system:orderReceiver" is both a DataReceiver and a DataEmitter. Data in a data flow moves from left to right. Data will continue to flow until the data flow is stopped.


The Strategy Engine configuration is predominantly established in strategyengine/conf/default.properties and user.properties. There are other settings in other files, but these are the files most commonly changed. The two files work together to define a key/value properties set that the Strategy Engine uses for configuration. Values are defined in default.properties and optionally overridden in user.properties. If the same key is defined in both files, user.properties takes precedence. It is recommended to copy the key/value pair you wish to modify from default.properties to user.properties. The Strategy Engine must be restarted for configuration changes to take effect.


This property defines the network interface on which the Strategy Engine listens for web services requests. The default value listens on the loopback address only. This is secure, but may not address your needs if you're running the Strategy Engine and Photon on different machines. This value can be either an IP address or a hostname. A reasonable alternative value is, which would make the Strategy Engine listen on all interfaces of the Strategy Engine.


This property defines the network port on which the Strategy Engine listens for web services requests. The default value is reasonable. You may need to change this if you already have something running on port 9001 on your Strategy Engine machine or if you're running more than one Strategy Engine on the same machine. Each Strategy Engine must be assigned a unique port.


This property defines the network port on which the Strategy Engine listens for RPC requests. The functional contents are identical for RPC and web services. It's just another way to get at the same features.


This property defines the URL for the message bus over which data is pushed as opposed to polled via the web services host and port above. The same security considerations apply: you may need to change localhost to something more open. Unlike the two properties above, hostname and port are defined in the same property. If you're running more than one Strategy Engine on the same host, you'll need to change 61617 on the second Strategy Engine to a unique value.


This property defines the minimum level of log events to publish remotely. Events with log level less than this will not be published remotely.


This property defines the location of DARE to connect to. If DARE is running on a different machine, this value will have to be changed.


This property defines the username as which to connect to DARE.


This property defines the password as which to connect to the order routing system DARE.


This property defines the DARE web services host name.


This property defines the DARE web services port.


This property establishes the optional order ID prefix to attach to all orders from this Strategy Engine.

  • No labels


  1. When running the strategy engine batch file, I get the following error:

    C:\Program Files\Marketcetera\Marketcetera 2.4.1\strategyengine\bin>strategyengi
    Exception in thread "main" java.lang.UnsupportedClassVersionError: org/marketcet
    era/core/ApplicationContainer : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class: org.marketcetera.core.ApplicationContainer. Prog
    ram will exit.

    Is there a particular version of java that is required for the marketcetera 2.4.1 that is installed through installer?

    1. 2.4.1 requires Java7. This installer does not provide a version of Java. You are expected to provide and maintain your own version. At a guess, I would say that your default Java version is now Java8. You need to provide a JDK Java7 version and point to that. Easiest way is to modify SetEnv.bat to set JAVA_HOME and PATH to point to a Java7 JDK installation.

  2. Am I correct in assuming that the strategy engine will run only java  code?

    Can Marketcetera support Python, R or any other language? Compiled Code? Or can one think of making it support one's favourite Analytical app (TA) scripting language, so that the strategies that one has prototyped & tested using one's favourite TA app can run unmodified on Marketcetera?




    1. Marketcetera, in its current state, can run strategies in Java and Ruby. We did have an implementation of Python that could be rehydrated if interest is sufficient. We have considered R in the past, and it would be feasible. Pretty much any language that has a JSR223 implementation could be implemented.

  3. Hi Community,

    Im getting following error when I run startegyEngine.bat :

    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; sup
    port was removed in 8.0
    2018-01-14 11:30:35,861 INFO [main] ? (:) - Strategy Engine version '3.0.12' (b
    uild 743 17592 20180114T060033144Z)
    2018-01-14 11:30:41,232 ERROR [main] ? (:) - Unable to initialize application be
    cause of error: 'Unable to create the client module because the underlying clien
    t initialization failed. Look at the underlying cause for more details on the er
    ror. (Unable to connect to the server using the URL 'tcp://dare.marketcetera.com
    :61616', user name 'sujay', host name 'dare.marketcetera.com' and port number '9
    ,000'. Ensure that you have provided correct URL, user name, host name, port num
    ber and password to connect to the server and retry operation. (Remote exceptio
    n; see cause for details))'. Exiting...
    org.springframework.beans.factory.BeanCreationException: Error creating bean wit
    h name 'sa' defined in URL [file:C:/Marketcetera/Marketcetera-3.0.12/strategyeng
    ine/conf/sa/strategyengine.xml]: Invocation of init method failed; nested except
    ion is java.lang.RuntimeException: org.marketcetera.module.ModuleCreationExcepti
    on: Unable to create the client module because the underlying client initializat
    ion failed. Look at the underlying cause for more details on the error.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.
    at org.springframework.context.support.AbstractApplicationContext.finish
    at org.springframework.context.support.AbstractApplicationContext.refres
    at org.springframework.context.support.FileSystemXmlApplicationContext.<
    at org.springframework.context.support.FileSystemXmlApplicationContext.<
    at org.marketcetera.core.ApplicationContainer.generateContext(Applicatio
    at org.marketcetera.core.ApplicationContainer.start(ApplicationContainer
    at org.marketcetera.core.ApplicationContainer.main(ApplicationContainer.
    Caused by: java.lang.RuntimeException: org.marketcetera.module.ModuleCreationExc
    eption: Unable to create the client module because the underlying client initial
    ization failed. Look at the underlying cause for more details on the error.
    at org.marketcetera.strategyagent.StrategyAgent.start(StrategyAgent.java
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    ... 14 more
    Caused by: org.marketcetera.module.ModuleCreationException: Unable to create the
    client module because the underlying client initialization failed. Look at the
    underlying cause for more details on the error.
    at org.marketcetera.client.ClientModuleFactory.create(ClientModuleFactor
    at org.marketcetera.module.ModuleManager.createModule(ModuleManager.java
    at org.marketcetera.module.ModuleManager.initialize(ModuleManager.java:1
    at org.marketcetera.module.ModuleManager.init(ModuleManager.java:555)
    at org.marketcetera.strategyagent.StrategyAgent.init(StrategyAgent.java:
    at org.marketcetera.strategyagent.StrategyAgent.start(StrategyAgent.java
    ... 21 more
    Caused by: org.marketcetera.client.ConnectionException: Unable to connect to the
    server using the URL 'tcp://dare.marketcetera.com:61616', user name 'sujay', ho
    st name 'dare.marketcetera.com' and port number '9,000'. Ensure that you have pr
    ovided correct URL, user name, host name, port number and password to connect to
    the server and retry operation.
    at org.marketcetera.client.ClientImpl.connect(ClientImpl.java:1102)
    at org.marketcetera.client.ClientImpl.<init>(ClientImpl.java:650)
    at org.marketcetera.client.ClientManager$1.getClient(ClientManager.java:
    at org.marketcetera.client.ClientManager.init(ClientManager.java:87)
    at org.marketcetera.client.ClientModuleFactory.create(ClientModuleFactor
    ... 26 more
    Caused by: org.marketcetera.util.ws.wrappers.RemoteException: Remote exception;
    see cause for details
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshallException(JAXBEncode
    at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.
    at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:179)
    at org.apache.cxf.interceptor.ClientFaultConverter.processFaultDetail(Cl
    at org.apache.cxf.interceptor.ClientFaultConverter.handleMessage(ClientF
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
    at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMess
    at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleM
    at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleM
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:801)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleR
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleR
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(H
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:5
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:653)

    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndi
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13
    at com.sun.proxy.$Proxy78.login(Unknown Source)
    at org.marketcetera.util.ws.stateful.Client.login(Client.java:171)
    at org.marketcetera.client.ClientImpl.connectWebServices(ClientImpl.java
    at org.marketcetera.client.ClientImpl.connect(ClientImpl.java:1075)
    ... 30 more
    Caused by: org.marketcetera.util.except.I18NException: Login credentials were re
    at org.marketcetera.util.ws.stateful.AuthServiceImpl.loginImpl(AuthServi
    at org.marketcetera.util.ws.stateful.AuthServiceImpl.access$000(AuthServ
    at org.marketcetera.util.ws.stateful.AuthServiceImpl$1.call(AuthServiceI
    at org.marketcetera.util.ws.stateful.AuthServiceImpl$1.call(AuthServiceI
    at org.marketcetera.util.ws.stateless.StatelessRemoteCaller.execute(Stat
    at org.marketcetera.util.ws.stateful.AuthServiceImpl.login(AuthServiceIm
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(Abst
    at org.apache.cxf.jaxws.JAXWSMethodInvoker.performInvocation(JAXWSMethod
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker
    at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSM
    at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.jav
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInv
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInv
    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecu
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(Se
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(Abstract
    at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(Je
    at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTP
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Cont
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
    at org.eclipse.jetty.server.Server.handle(Server.java:499)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.jav
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool
    at java.lang.Thread.run(Thread.java:748)

    Please help me out.



    1. Is this still a problem for you? I see this in the DARE log:

      14 Jan 2018 07:21:46,664  INFO [ActiveMQ Transport: tcp://x.x.x.x:56171@9600] ors.security.ORSLoginModule (:) - User 'sujayh1988' successfully logged in.
      1. Colin its no more an issue. Thanks!!.. I had given wrong user name

  4. hello. master

    In version 3.0.12, does the sample directory not exist in the engine directory?

    If so, how do I get the sample directory and files?

    Please help me.

    1. The samples are available in the source code:

      $ tree strategyagent/src/main/sample_data/samples/
      ├── java
      │   ├── inputs
      │   │   ├── HelloWorld.txt
      │   │   ├── MarketData.txt
      │   │   ├── MovingAverages.txt
      │   │   ├── OrderSender.txt
      │   │   ├── OrderSlicer.txt
      │   │   ├── ProcessData.txt
      │   │   └── VWAPStrategy.txt
      │   └── scripts
      │       ├── HelloWorld.java
      │       ├── MarketData.java
      │       ├── MovingAverages.java
      │       ├── OrderSender.java
      │       ├── OrderSlicer.java
      │       ├── ProcessData.java
      │       └── VWAPStrategy.java
      └── ruby
          ├── inputs
          │   ├── HelloWorld.txt
          │   ├── MarketData.txt
          │   ├── MovingAverages.txt
          │   ├── OrderSender.txt
          │   ├── OrderSlicer.txt
          │   ├── ProcessData.txt
          │   └── VWAPStrategy.txt
          └── scripts
              ├── hello_world.rb
              ├── market_data.rb
              ├── moving_averages.rb
              ├── order_sender.rb
              ├── order_slicer.rb
              ├── process_data.rb
              └── vwap_strategy.rb
      6 directories, 28 files

      They can be found here.

      1. Thank you very much. 

        I confirmed that existence.

        Thank you!!.