Dear Developers and Traders,

Intro
I would like to share with you custom Maven plugin that facilities packaging of strategies, plugins and indicators to .jfx file directly from your favorite IDE. The plugin is especially helpful if your project consists of many classes and/or external libraries.

Current situation
Without the plugin, if you have a project that contains several classes, your options are two:
1. Keep all classes in one file – terrible to structure your code and navigate around, difficult to keep the code clean.
2. Compile your project in IDE into to a jar file, and then use @Library annotation and link your project with the Strategy file. This forces you to compile things in two places – JForex Platform and your IDE – it is time wasting and error prone.

Plugin advantages
The JFX Packer Maven plugin compiles your project to .jfx file from your IDE level, therefore, the whole development and packing process takes place in the IDE. You use the JForex platform only to run the output (strategy, plugin or indicator).

How to use the plugin
In order to use the plugin you need to update your pom.xml file by two elements:
1. Plugin repository information - required for the project to know where to download the plugin from.
2. Maven-jar-plugin configuration – required to update manifest.mf file to comply with JForex compiler requirements.
3. JFX Packer plugin configuration – the actual plugin confirmation.

Plugin configuration parameters
The JFX Packer plugin contains two configuration parameters:
1) Input artifacts – jar file name(s) to be compiled to .jfx file. For example if your project produces a file with following name: my_strategy-1.0.0.jar, then you would put here my_strategy-1.0.0. You can use also maven variables, for example ${project.artifactId}-${project.version}.
2) copyJfxFileTo – .jfx file gets created in the same directory where the original .jar file lies. You can tell the plugin to copy compliled .jfx file to your strategy folder for easy access from JForex platform.

How to get the plugin
Below you will find a link to support forum post which contains usage example of the Maven plugin with simple strategy Equity Take Profit.
There is not much logic behind, it is just to present how to use the plugin. Please, review to better understand how it works.

Sample Maven Plugin usage


Hope it will be helpful for your daily activities. Please, let me know your feedback if you find the plugin useful.

All the best
Greg
翻訳する: 英語 オリジナルを表示