Interface CassandreStrategyInterface

    • Method Detail

      • setStrategy

        void setStrategy​(StrategyDTO newStrategyDTO)
        Setter strategyDTO.
        Parameters:
        newStrategyDTO - strategy DTO.
      • initializeAccounts

        void initializeAccounts​(Map<String,​AccountDTO> accounts)
        Initialize strategy accounts with exchange accounts data.
        Parameters:
        accounts - accounts
      • setPositionFlux

        void setPositionFlux​(PositionFlux newPositionFlux)
        Setter position flux.
        Parameters:
        newPositionFlux - position flux
      • setOrderRepository

        void setOrderRepository​(OrderRepository newOrderRepository)
        Setter order repository.
        Parameters:
        newOrderRepository - order repository
      • setTradeRepository

        void setTradeRepository​(TradeRepository newTradeRepository)
        Setter trade repository.
        Parameters:
        newTradeRepository - trade repository.
      • setPositionRepository

        void setPositionRepository​(PositionRepository newPositionRepository)
        Setter positionRepository.
        Parameters:
        newPositionRepository - the positionRepository to set
      • setImportedTickersRepository

        void setImportedTickersRepository​(ImportedTickersRepository newImportedTickersRepository)
        Setter ImportedTickersRepository.
        Parameters:
        newImportedTickersRepository - ImportedTickers Repository
      • setExchangeService

        void setExchangeService​(ExchangeService newExchangeService)
        Setter for exchangeService.
        Parameters:
        newExchangeService - exchange service
      • setTradeService

        void setTradeService​(TradeService newTradeService)
        Setter for tradeService.
        Parameters:
        newTradeService - the tradeService to set
      • setPositionService

        void setPositionService​(PositionService newPositionService)
        Setter for positionService.
        Parameters:
        newPositionService - position service
      • accountsUpdates

        void accountsUpdates​(Set<AccountDTO> accounts)
        Method called by streams on accounts updates.
        Parameters:
        accounts - accounts updates
      • tickersUpdates

        void tickersUpdates​(Set<TickerDTO> tickers)
        Method called by streams on tickers updates.
        Parameters:
        tickers - tickers updates
      • ordersUpdates

        void ordersUpdates​(Set<OrderDTO> orders)
        Method called by streams on orders updates.
        Parameters:
        orders - orders updates
      • tradesUpdates

        void tradesUpdates​(Set<TradeDTO> trades)
        Method called by streams on trades updates.
        Parameters:
        trades - trades updates
      • positionsUpdates

        void positionsUpdates​(Set<PositionDTO> positions)
        Method called by streams on positions updates.
        Parameters:
        positions - positions updates
      • getRequestedCurrencyPairs

        Set<CurrencyPairDTO> getRequestedCurrencyPairs()
        Implements this method to tell the bot which currency pairs your strategy will receive.
        Returns:
        the list of currency pairs tickers your want to receive in this strategy
      • getTradeAccount

        Optional<AccountDTO> getTradeAccount​(Set<AccountDTO> accounts)
        Implements this method to tell the bot which account from the accounts you own is the one you use for trading.
        Parameters:
        accounts - all your accounts
        Returns:
        your trading account
      • getTradeAccount

        Optional<AccountDTO> getTradeAccount()
        Returns the trading account.
        Returns:
        your trading account
      • initialize

        void initialize()
        This method is called by Cassandre before flux are started. For example, you can implement this method to prepare your historical data.
      • onAccountsUpdates

        void onAccountsUpdates​(Map<String,​AccountDTO> accounts)
        Method called by Cassandre when there are accounts updates.
        Parameters:
        accounts - accounts updates
      • onTickersUpdates

        void onTickersUpdates​(Map<CurrencyPairDTO,​TickerDTO> tickers)
        Method called by Cassandre when there are tickers updates.
        Parameters:
        tickers - tickers updates
      • onOrdersUpdates

        void onOrdersUpdates​(Map<String,​OrderDTO> orders)
        Method called by Cassandre when there are orders updates.
        Parameters:
        orders - orders updates
      • onTradesUpdates

        void onTradesUpdates​(Map<String,​TradeDTO> trades)
        Method called by Cassandre when there are trades updates.
        Parameters:
        trades - trades updates
      • onPositionsUpdates

        void onPositionsUpdates​(Map<Long,​PositionDTO> positions)
        Method called by Cassandre when there are positions updates.
        Parameters:
        positions - positions updates
      • onPositionsStatusUpdates

        void onPositionsStatusUpdates​(Map<Long,​PositionDTO> positions)
        Method called by Cassandre when there are positions status updates.
        Parameters:
        positions - positions status updates