Strategy configuration

Class in charge of configuring and running the user strategy.

StrategyConfiguration.

The StrategyAutoConfiguration search for the user strategy class marked with the @CassandreStrategy annotation and extending BasicCassandreStrategy or BasicTa4jCassandreStrategy.

This class does the following steps :

  • Check if there is one and only one User strategy marked with the @CassandreStrategy annotation.

  • Check if this strategy extends BasicCassandreStrategy or BasicTa4jCassandreStrategy.

  • Connect the AccountFlux to theaccountUpdate() method of the strategy.

  • Connect the PositionFlux to thepositionUpdate() method of the strategy.

  • Connect the TickerFlux to the onTickerUpdate() method of the strategy (after calling getRequestedCurrencyPairs() on a strategy to know which currency pairs to retrieve).

  • Connect the OrderFlux to the orderUpdate() method of the strategy.

  • Connect the TradeFlux to the tradeUpdate() method of the strategy.

  • Set the trade service.

  • Set the position service.

  • Restore trade and positions from the database.