Introduction.

We are going to use ta4j, an open source Java library for technical analysis. It provides the basic components for creation, evaluation and execution of trading strategies.

Create your project.

Prerequisite : java jdk 11 & maven must be installed.

Just type this command :

mvn -B archetype:generate -DarchetypeGroupId=tech.cassandre.trading.bot -DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-archetype -DarchetypeVersion=1.0.0 -DgroupId=tech.cassandre.trading.strategy -DartifactId=ta4j-strategy -Dversion=1.0-SNAPSHOT -Dpackage=tech.cassandre.trading.strategy

The latest release is :

Maven Central.

The created project is a spring boot project with the following structure :

ta4j-strategy/
├── pom.xml
└── src
    ├── main
    │   ├── java
    │   │   └── tech
    │   │       └── cassandre
    │   │           └── trading
    │   │               └── strategy
    │   │                   ├── Application.java
    │   │                   ├── package-info.java
    │   │                   └── SimpleStrategy.java
    │   └── resources
    │       └── application.properties
    └── test
        └── java
            └── tech
                └── cassandre
                    └── trading
                        └── strategy
                            └── SimpleStrategyTest.java

Add ta4j.

Edit pom.xml and add this dependency :

<dependency>
    <groupId>org.ta4j</groupId>
    <artifactId>ta4j-core</artifactId>
    <version>0.13</version>
</dependency>