service

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseInfoSrv

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

func (*BaseInfoSrv) GetAllShares

func (i *BaseInfoSrv) GetAllShares(ctx context.Context) (*dtotapi.SharesResponse, error)

func (*BaseInfoSrv) GetDataStream

func (i *BaseInfoSrv) GetDataStream(ctx context.Context) (investapi.MarketDataStreamService_MarketDataStreamClient, error)

func (*BaseInfoSrv) GetHistorySorted

func (i *BaseInfoSrv) GetHistorySorted(figis []string, ivl investapi.CandleInterval, startTime time.Time, endTime time.Time, ctx context.Context) ([]entity.History, error)

func (*BaseInfoSrv) GetInstrumentInfoByFigi

func (i *BaseInfoSrv) GetInstrumentInfoByFigi(figi string, ctx context.Context) (*dtotapi.InstrumentResponse, error)

func (*BaseInfoSrv) GetLastPrices

func (i *BaseInfoSrv) GetLastPrices(figis []string, ctx context.Context) (*dtotapi.LastPricesResponse, error)

type InfoProdService

type InfoProdService struct {
	*BaseInfoSrv
	// contains filtered or unexported fields
}

func (*InfoProdService) GetAccounts

func (is *InfoProdService) GetAccounts(ctx context.Context) (*dtotapi.AccountsResponse, error)

func (*InfoProdService) GetOrderState

func (*InfoProdService) GetPositions

type InfoSandboxService

type InfoSandboxService struct {
	*BaseInfoSrv
	// contains filtered or unexported fields
}

func (*InfoSandboxService) GetAccounts

func (*InfoSandboxService) GetOrderState

func (*InfoSandboxService) GetPositions

type InfoSrv

type InfoSrv interface {
	//GetHistorySorted return sorted by time history in time interval
	GetHistorySorted(finis []string, ivl investapi.CandleInterval, startTime time.Time, endTime time.Time, ctx context.Context) ([]entity.History, error)

	//GetDataStream returns bidirectional data stream client
	GetDataStream(ctx context.Context) (investapi.MarketDataStreamService_MarketDataStreamClient, error)

	//GetAllShares return all shares, available for operating through API
	GetAllShares(ctx context.Context) (*dtotapi.SharesResponse, error)

	//GetInstrumentInfoByFigi returns instrument information by figi identifier
	GetInstrumentInfoByFigi(figi string, ctx context.Context) (*dtotapi.InstrumentResponse, error)
	//GetOrderState returns current order state and other info
	GetOrderState(req *dtotapi.OrderStateRequest, ctx context.Context) (*dtotapi.OrderStateResponse, error)

	//GetAccounts returns accounts for the token
	GetAccounts(ctx context.Context) (*dtotapi.AccountsResponse, error)

	//GetLastPrices returns last price for the instrument
	GetLastPrices(figis []string, ctx context.Context) (*dtotapi.LastPricesResponse, error)

	//GetPositions returns current amount of money and instrument from the requested account
	GetPositions(req *dtotapi.PositionsRequest, ctx context.Context) (*dtotapi.PositionsResponse, error)
}

func NewInfoProdService

func NewInfoProdService(t tinapi.Api, logger *zap.SugaredLogger) InfoSrv

func NewInfoSandboxService

func NewInfoSandboxService(t tinapi.Api, logger *zap.SugaredLogger) InfoSrv

type StatService

type StatService interface {
	//GetAlgorithmStat returns statistics for the algorithm id
	GetAlgorithmStat(req *dto.StatAlgoRequest) (*dto.StatAlgoResponse, error)
}

func NewStatService

func NewStatService(statRep repository.StatRepository, logger *zap.SugaredLogger) StatService

type StatServiceImpl

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

func (*StatServiceImpl) GetAlgorithmStat

func (ss *StatServiceImpl) GetAlgorithmStat(req *dto.StatAlgoRequest) (*dto.StatAlgoResponse, error)

type TradeProdService

type TradeProdService struct {
	TinApi tinapi.Api
	// contains filtered or unexported fields
}

func (*TradeProdService) CancelOrder

func (*TradeProdService) GetOrderStatus

func (*TradeProdService) PostOrder

type TradeSandboxService

type TradeSandboxService struct {
	TinApi tinapi.Api
	// contains filtered or unexported fields
}

func (*TradeSandboxService) CancelOrder

func (*TradeSandboxService) GetOrderStatus

func (*TradeSandboxService) PostOrder

type TradeService

type TradeService interface {
	//PostOrder posts order with requested params
	PostOrder(req *dtotapi.PostOrderRequest, ctx context.Context) (*dtotapi.PostOrderResponse, error)

	//GetOrderStatus returns status and information about the order
	GetOrderStatus(req *dtotapi.OrderStateRequest, ctx context.Context) (*dtotapi.OrderStateResponse, error)

	//CancelOrder cancels order and returns cancel result
	CancelOrder(req *dtotapi.CancelOrderRequest, ctx context.Context) (*dtotapi.CancelOrderResponse, error)
}

TradeService provides methods for order management

func NewTradeProdService

func NewTradeProdService(tapi tinapi.Api, logger *zap.SugaredLogger) TradeService

func NewTradeSandboxSrv

func NewTradeSandboxSrv(tapi tinapi.Api, logger *zap.SugaredLogger) TradeService

Jump to

Keyboard shortcuts

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