symbols

package
v4.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	GetAllIdentifiers() []string
	GetAllIndexIdentifiers() []string
}

Manager manages symbols in the target stock exchanges. symbol(s) can be newly registered / removed from the exchange, so target symbols should be update periodically.

type ManagerImpl

type ManagerImpl struct {
	APIClient         api.Client
	TargetExchanges   []string
	TargetIndexGroups []string
	NotQuoteStockList map[string]struct{}
	// identifier = {symbol}.{exchange} (i.e. "7203.XTKS").
	Identifiers map[string][]string
	// IndexIdentifiers are the identifiers for index symbols (ex. "151.INDXJPX" (=TOPIX))
	IndexIdentifiers map[string][]string
}

ManagerImpl is an implementation of the Manager.

func NewManager

func NewManager(apiClient api.Client, targetExchanges, targetIndexGroups, notQuoteStockList []string) *ManagerImpl

NewManager initializes the SymbolManager object with the specified parameters.

func (*ManagerImpl) GetAllIdentifiers

func (m *ManagerImpl) GetAllIdentifiers() []string

GetAllIdentifiers returns Identifiers for the target symbols for all the target exchanges identifier = {exchange}.{symbol} (ex. "XTKS.1301").

func (*ManagerImpl) GetAllIndexIdentifiers

func (m *ManagerImpl) GetAllIndexIdentifiers() []string

GetAllIndexIdentifiers returns Identifiers for the target index symbols for all the index groups identifier = {exchange}.{symbol} (ex. "XTKS.1301").

func (*ManagerImpl) Update

func (m *ManagerImpl) Update(ctx context.Context)

Update calls UpdateSymbols and UpdateIndexSymbols sequentially.

func (*ManagerImpl) UpdateIndexSymbols

func (m *ManagerImpl) UpdateIndexSymbols(ctx context.Context)

UpdateIndexSymbols calls the ListIndexSymbols endpoint, convert the index symbols to the Identifiers and store them to the Identifiers map.

func (*ManagerImpl) UpdateSymbols

func (m *ManagerImpl) UpdateSymbols(ctx context.Context)

UpdateSymbols calls the ListSymbols endpoint, convert the symbols to the Identifiers and store them to the Identifiers map.

Jump to

Keyboard shortcuts

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