Class BasicCassandreStrategy
- java.lang.Object
-
- tech.cassandre.trading.bot.strategy.BasicCassandreStrategy
-
- All Implemented Interfaces:
CassandreStrategyInterface
public abstract class BasicCassandreStrategy extends Object implements CassandreStrategyInterface
Basic strategy - Cassandre bot will run the first BasicCassandreStrategy implementation found.
-
-
Constructor Summary
Constructors Constructor Description BasicCassandreStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accountUpdate(AccountDTO account)
Method called by streams at every account update.Map<String,AccountDTO>
getAccounts()
Getter for of accounts.Map<String,OrderDTO>
getOrders()
Getter for of orders.Map<Long,PositionDTO>
getPositions()
Getter for of positions.PositionService
getPositionService()
Getter for positionService.Map<String,TradeDTO>
getTrades()
Getter for of trades.TradeService
getTradeService()
Getter for tradeService.void
onAccountUpdate(AccountDTO account)
Method triggered at every account update.void
onOrderUpdate(OrderDTO order)
Method triggered on every order update.void
onPositionUpdate(PositionDTO position)
Method triggered on every position update.void
onTickerUpdate(TickerDTO ticker)
Method triggered at every ticker update.void
onTradeUpdate(TradeDTO trade)
Method triggered on every trade update.void
orderUpdate(OrderDTO order)
Method called by streams on every order update.void
positionUpdate(PositionDTO position)
Method called by streams on every position update.void
setPositionService(PositionService newPositionService)
Setter for positionService.void
setTradeService(TradeService newTradeService)
Setter for tradeService.void
tickerUpdate(TickerDTO ticker)
Method called by streams at every ticker update.void
tradeUpdate(TradeDTO trade)
Method called by streams on every trade update.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface tech.cassandre.trading.bot.strategy.CassandreStrategyInterface
getRequestedCurrencyPairs
-
-
-
-
Method Detail
-
setTradeService
public final void setTradeService(TradeService newTradeService)
Description copied from interface:CassandreStrategyInterface
Setter for tradeService.- Specified by:
setTradeService
in interfaceCassandreStrategyInterface
- Parameters:
newTradeService
- the tradeService to set
-
setPositionService
public final void setPositionService(PositionService newPositionService)
Description copied from interface:CassandreStrategyInterface
Setter for positionService.- Specified by:
setPositionService
in interfaceCassandreStrategyInterface
- Parameters:
newPositionService
- position service
-
getTradeService
public final TradeService getTradeService()
Description copied from interface:CassandreStrategyInterface
Getter for tradeService.- Specified by:
getTradeService
in interfaceCassandreStrategyInterface
- Returns:
- tradeService
-
getPositionService
public final PositionService getPositionService()
Description copied from interface:CassandreStrategyInterface
Getter for positionService.- Specified by:
getPositionService
in interfaceCassandreStrategyInterface
- Returns:
- positionService
-
accountUpdate
public final void accountUpdate(AccountDTO account)
Description copied from interface:CassandreStrategyInterface
Method called by streams at every account update.- Specified by:
accountUpdate
in interfaceCassandreStrategyInterface
- Parameters:
account
- account
-
tickerUpdate
public final void tickerUpdate(TickerDTO ticker)
Description copied from interface:CassandreStrategyInterface
Method called by streams at every ticker update.- Specified by:
tickerUpdate
in interfaceCassandreStrategyInterface
- Parameters:
ticker
- ticker
-
orderUpdate
public final void orderUpdate(OrderDTO order)
Description copied from interface:CassandreStrategyInterface
Method called by streams on every order update.- Specified by:
orderUpdate
in interfaceCassandreStrategyInterface
- Parameters:
order
- order
-
tradeUpdate
public final void tradeUpdate(TradeDTO trade)
Description copied from interface:CassandreStrategyInterface
Method called by streams on every trade update.- Specified by:
tradeUpdate
in interfaceCassandreStrategyInterface
- Parameters:
trade
- trade
-
positionUpdate
public final void positionUpdate(PositionDTO position)
Description copied from interface:CassandreStrategyInterface
Method called by streams on every position update.- Specified by:
positionUpdate
in interfaceCassandreStrategyInterface
- Parameters:
position
- trade
-
getAccounts
public final Map<String,AccountDTO> getAccounts()
Getter for of accounts.- Returns:
- accounts
-
getPositions
public final Map<Long,PositionDTO> getPositions()
Getter for of positions.- Returns:
- positions
-
onAccountUpdate
public void onAccountUpdate(AccountDTO account)
Description copied from interface:CassandreStrategyInterface
Method triggered at every account update.- Specified by:
onAccountUpdate
in interfaceCassandreStrategyInterface
- Parameters:
account
- account
-
onTickerUpdate
public void onTickerUpdate(TickerDTO ticker)
Description copied from interface:CassandreStrategyInterface
Method triggered at every ticker update.- Specified by:
onTickerUpdate
in interfaceCassandreStrategyInterface
- Parameters:
ticker
- ticker
-
onOrderUpdate
public void onOrderUpdate(OrderDTO order)
Description copied from interface:CassandreStrategyInterface
Method triggered on every order update.- Specified by:
onOrderUpdate
in interfaceCassandreStrategyInterface
- Parameters:
order
- order
-
onTradeUpdate
public void onTradeUpdate(TradeDTO trade)
Description copied from interface:CassandreStrategyInterface
Method triggered on every trade update.- Specified by:
onTradeUpdate
in interfaceCassandreStrategyInterface
- Parameters:
trade
- trade
-
onPositionUpdate
public void onPositionUpdate(PositionDTO position)
Description copied from interface:CassandreStrategyInterface
Method triggered on every position update.- Specified by:
onPositionUpdate
in interfaceCassandreStrategyInterface
- Parameters:
position
- position
-
-