Documentation
¶
Index ¶
- type BaseTradeAPI
- type DefaultHistoryAPI
- func (h *DefaultHistoryAPI) AnalyzeAlgo(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.HistStatResponse, error)
- func (h *DefaultHistoryAPI) AnalyzeAlgoInRange(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.HistStatInRangeResponse, error)
- func (h *DefaultHistoryAPI) LoadHistory(figis []string, ivl investapi.CandleInterval, startTime time.Time, ...) error
- type DefaultStatAPI
- type HistoryAPI
- type StatAPI
- type TradeAPI
- type TradeProdAPI
- type TradeSandboxAPI
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 ¶
func (ta *BaseTradeAPI) StopAlgorithm(req *dto.StopAlgorithmRequest) (*dto.StopAlgorithmResponse, error)
type DefaultHistoryAPI ¶
type DefaultHistoryAPI struct {
// contains filtered or unexported fields
}
func (*DefaultHistoryAPI) AnalyzeAlgo ¶
func (h *DefaultHistoryAPI) AnalyzeAlgo(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.HistStatResponse, error)
func (*DefaultHistoryAPI) AnalyzeAlgoInRange ¶
func (h *DefaultHistoryAPI) AnalyzeAlgoInRange(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.HistStatInRangeResponse, 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
func NewHistoryAPI ¶
func NewHistoryAPI(infoSrv service.InfoSrv, histRep repository.HistoryRepository, aFact strategy.AlgFactory, aRep repository.AlgoRepository, logger *zap.SugaredLogger) HistoryAPI
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 ¶
func (t *TradeProdAPI) Trade(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.TradeStartResponse, error)
type TradeSandboxAPI ¶
type TradeSandboxAPI struct { *BaseTradeAPI // contains filtered or unexported fields }
func (*TradeSandboxAPI) GetActiveAlgorithms ¶
func (t *TradeSandboxAPI) GetActiveAlgorithms() (*dto.AlgorithmsResponse, error)
func (TradeSandboxAPI) Trade ¶
func (t TradeSandboxAPI) Trade(req *dto.CreateAlgorithmRequest, ctx context.Context) (*dto.TradeStartResponse, error)
Click to show internal directories.
Click to hide internal directories.