bot

package
v0.0.0-...-51300c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseTradeAPI

type BaseTradeAPI struct {
	// contains filtered or unexported fields
}

func (*BaseTradeAPI) StopAlgorithm

type DefaultHistoryAPI

type DefaultHistoryAPI struct {
	// contains filtered or unexported fields
}

func (*DefaultHistoryAPI) AnalyzeAlgo

func (*DefaultHistoryAPI) AnalyzeAlgoInRange

func (*DefaultHistoryAPI) LoadHistory

func (h *DefaultHistoryAPI) LoadHistory(figis []string, ivl investapi.CandleInterval, startTime time.Time, endTime time.Time, ctx context.Context) error

type DefaultStatAPI

type DefaultStatAPI struct {
	// contains filtered or unexported fields
}

func (*DefaultStatAPI) GetAlgorithmStat

func (st *DefaultStatAPI) GetAlgorithmStat(req *dto.StatAlgoRequest) (*dto.StatAlgoResponse, error)

type HistoryAPI

type HistoryAPI interface {
	//LoadHistory loads history from API and replace existing data in database with newly retrieved
	LoadHistory(figis []string, ivl investapi.CandleInterval, startTime time.Time, endTime time.Time, ctx context.Context) error
	//AnalyzeAlgo Analyze algorithm with fixed parameters
	AnalyzeAlgo(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.HistStatResponse, error)
	//AnalyzeAlgoInRange Analyze algorithm with parameter variation
	AnalyzeAlgoInRange(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.HistStatInRangeResponse, error)
}

HistoryAPI is an interface for interacting with history data

type StatAPI

type StatAPI interface {
	//GetAlgorithmStat collects and returns statistics on the algorithm with requested id
	GetAlgorithmStat(req *dto.StatAlgoRequest) (*dto.StatAlgoResponse, error)
}

func NewStatAPI

func NewStatAPI(statRep service.StatService, logger *zap.SugaredLogger) StatAPI

type TradeAPI

type TradeAPI interface {
	//Trade starts trading with provided parameters
	Trade(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.TradeStartResponse, error)
	//GetActiveAlgorithms returns list of active algorithms
	GetActiveAlgorithms() (*dto.AlgorithmsResponse, error)
	//StopAlgorithm stops algorithm with requested id
	StopAlgorithm(req *dto.StopAlgorithmRequest) (*dto.StopAlgorithmResponse, error)
}

func NewSandboxTradeAPI

func NewSandboxTradeAPI(infoSrv service.InfoSrv, algFactory strategy.AlgFactory, algRep repository.AlgoRepository,
	trader trade.Trader, logger *zap.SugaredLogger) TradeAPI

func NewTradeProdAPI

func NewTradeProdAPI(infoSrv service.InfoSrv, algFactory strategy.AlgFactory, algRep repository.AlgoRepository,
	trader trade.Trader, logger *zap.SugaredLogger) TradeAPI

type TradeProdAPI

type TradeProdAPI struct {
	*BaseTradeAPI
	// contains filtered or unexported fields
}

func (*TradeProdAPI) GetActiveAlgorithms

func (t *TradeProdAPI) GetActiveAlgorithms() (*dto.AlgorithmsResponse, error)

func (*TradeProdAPI) Trade

type TradeSandboxAPI

type TradeSandboxAPI struct {
	*BaseTradeAPI
	// contains filtered or unexported fields
}

func (*TradeSandboxAPI) GetActiveAlgorithms

func (t *TradeSandboxAPI) GetActiveAlgorithms() (*dto.AlgorithmsResponse, error)

func (TradeSandboxAPI) Trade

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL