Waiting for Dynami-UI and Dynami-DevTools we can start configuring our development environment using free and open source tools and then start developing and executing our first trading strategy.
Dynami is a Java 8 application, so we need a Java Development Kit (JDK) in order to compile our code. Download the latest Java 8 JDK from Oracle website clicking here.
We also need an IDE for writing Java code. If you are not an experienced Java programmer I suggest you latest “Eclipse IDE for Java Developers”, you can download it clicking here. Also others Java IDEs can be used, but you will need to configure projects’ classpaths manually (Maven porting is in progress, to make classpath settings independent from IDE).
Fork all Dynami projects from GitHub following https://github.com/Dynami. You will find four projects:
- Dynami-Core contains foundation classes needed to develop trading strategies, root packaged with org.dynami.core.
- Dynami-Ta is an optional library with a bunch of pre-programmed technical indicators (you can also build your own). Root packaged with org.dynami.ta.
- Dynami-Runtime contains execution engine and main class to execute the application. Root packaged with org.dynami.runtime.
- Dynami-Sample-Strategy is a complete and runnable trading strategy.
Just to understand dependencies among projects take a look to following figure. Third part libraries are embedded in “libs” directories. Each library depends from those ones which stand below. Dashed ones are optional.

Now we have all the necessary to start. Dynami currently can be executed only using command line. Yes, I know it is quite tricky and old fashioned, but Dynami’s user interface is still far.
Before starting execution you have to check:
- all four projects must be compiled without errors (in modern IDEs compilation phase is automatic).
- Export Dynami-Sample-Strategy as a jar in order to make it executable. If you make some changes you have to re-export it again (in resource directory you will find a compiled one).
- By default timeframe is set to Daily, you can change it programmatically editing TextFileDataHandler::init() method on Dynamy-Runtime.
- Set clockFrequence attribute for speed execution. Set to zero for no pauses (max speed execution depends from your PC);
- Message Broker is forced to sync mode to give deterministic results in test mode.
- Point org.dynami.runtime.exec.Starter class on Dynami-Runtime check file-paths and execute it as a Java application.
public static void main(String[] args) {
try {
new Starter().execute(new String[]{
// set proper path, but let empty file for the moment
"-file", "../Dynami-Sample-Strategy/resources/myPersonalSettings.dynami",
// set proper path
"-strategy_lib", "../Dynami-Sample-Strategy/resources/dynami.sample.strategy_v1.jar"});
} catch (Exception e) {
e.printStackTrace();
}
}
- Command strategy execution by command line.
If it’s all ok, a message like this is prompted in console:
Use the following commands to handle strategy execution:
L+Enter to load
R+Enter to run/resume
P+Enter to pause
S+Enter to stop
E+Enter to shutdown Dynami
X+Enter to print strategy status
XX+Enter to print deep strategy status (with closed positions)
In Dynami-Sample-Strategy we’ve implemented RSI2 trading system developed by Larry Connors. You can find strategy explanation in ChartSchool website clicking here. In this way you can see a real implementation on Dynami.
Dynami is still quite unripe, but it is a working progress. If you have some suggestion leave a comment or write a user story in UserStory page.
Thank you and see you soon.
Glossary:
- IDE – Integrated Development Environment
- JDK – Java Development Kit
- SWT – Standard Widget Toolkit
- RSI – Relative Strength Index