Create your strategy

Your strategy is in src/main/java/tech/cassandre/trading/strategy/

Choose the requested currency pair.

This is done by implementing getRequestedCurrencyPair() this way :

public CurrencyPairDTO getRequestedCurrencyPair() {
return new CurrencyPairDTO(BTC, USDT);

Choose the number of bars.

This is done by implementing getMaximumBarCount() this way :

public int getMaximumBarCount() {
return 10;

Choose the delay between two bars.

This is done by implementing getDelayBetweenTwoBars() this way :

public Duration getDelayBetweenTwoBars() {
return Duration.ofDays(1);

Create your strategy.

Now it's time to implement your own strategy, here, we chose Simple Moving Average (SMA) :

public Strategy getStrategy() {
ClosePriceIndicator closePrice = new ClosePriceIndicator(getSeries());
SMAIndicator sma = new SMAIndicator(closePrice, getMaximumBarCount());
return new BaseStrategy(new UnderIndicatorRule(sma, closePrice), new OverIndicatorRule(sma, closePrice));