Overview

If you are new to trading, you can read our tutorial "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 market orders with the methods :

  • createBuyMarketOrder().

  • createSellMarketOrder().

And limit orders with :

  • createBuyLimitOrder().

  • createSellLimitOrder().

You can also create positions with :

  • createLongPosition().

A position will automatically create a buy order. From now, for every ticker received, Cassandre will check the gain or loss made on this position, if it triggers one of the rules you set, Cassandre will create a sell order to close it.

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