If you are new to trading, you can read trading basics.

A trading bot is a computer program that can automatically place orders to a market or exchange without the need for human intervention. Automated trading strategies are the future of investing, they are working for you 24/7 and never lose their focus.

Cassandre trading bot (available as a Spring boot starter) allows you to create and execute your own trading strategy in seconds on most crypto exchanges. We also provide a dry mode and a spring boot starter to backtest your bot on historical or real-time data.

Once the starter is added to your Spring Boot project, it will search for a class having the @CassandreStrategy annotation and extending BasicCassandreStrategy or BasicTa4jCassandreStrategy.

For a BasicCassandreStrategy, you have to implement :

  • getRequestedCurrencyPairs()to indicate the list of currency pairs tickers you want to receive.

  • getTradeAccount(Set<AccountDTO> accounts) to indicate which account is your trading account.

Then, to be notified of updated data, you can override the following methods :

  • onAccountUpdate() to receive updates about your account.

  • onTickerUpdate()to receive new tickers.

  • onOrderUpdate()to receive updates about your orders.

  • onTradeUpdate() to receive updates about your trades.

  • onPositionUpdate() to receive updates about your positions.

  • onPositionStatusUpdate() to receive updates about positions status change.

Inside your strategy, you can create orders or positions with a call to getTradeService()or getPositionService().

You can also create a strategy using ta4j, to know more about it read the technical analysis chapter.