Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnomalyDetector ¶
type Detector ¶
type Detector interface { // NeedAction checks need to buy, sell assets or do nothing. NeedAction(price decimal.Decimal) (entity.Action, error) // LastAction returns last decision made by detector. LastAction() entity.Action }
Detector checks need to buy, sell assets or do nothing. This service must be instantiated for every trade pair separately.
type TradeService ¶
type TradeService struct {
// contains filtered or unexported fields
}
TradeService makes trades for specific trade pair.
func NewTradeService ¶
func NewTradeService(l *zap.Logger, pair entity.Pair, amount decimal.Decimal, pricer Pricer, detector Detector, trader Trader, anomalyDetector AnomalyDetector) *TradeService
NewTradeService creates new TradeService instance.
func (*TradeService) Trade ¶
func (t *TradeService) Trade() (*entity.TradeEvent, error)
Trade checks current price of asset and decides whether to buy, sell or do anything.
Click to show internal directories.
Click to hide internal directories.