algorithm

package
v0.0.0-...-1513131 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALGORITHM_NAME_LABEL            = "algorithm_name"
	ALGORITHM_ADAPTER_DELIMITER     = ","
	LEN_ALGORITHM_ADAPTER_DELIMITER = 1
)

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(ctx context.Context, data string, monitoring monitor.Monitoring) (indicator_adaptor.IndicatorAdaptor, error)

func GetUpdatedCommonLabelsContext

func GetUpdatedCommonLabelsContext(ctx context.Context, name string) context.Context

func PutEvaluateResponse

func PutEvaluateResponse(signal *model.TradingSignal)

Types

type AlgorithmIdentifier

type AlgorithmIdentifier struct {
	Algorithm AlgorithmName
	// contains filtered or unexported fields
}

AlgorithmIdentifier uniquely identifies an AlgorithmName and provides custom equality logic.

func NewAlgorithmIdentifier

func NewAlgorithmIdentifier() *AlgorithmIdentifier

func (*AlgorithmIdentifier) Add

func (ai *AlgorithmIdentifier) Add(s string)

func (*AlgorithmIdentifier) CleanUp

func (ai *AlgorithmIdentifier) CleanUp()

func (*AlgorithmIdentifier) Key

func (ai *AlgorithmIdentifier) Key() string

type AlgorithmName

type AlgorithmName []string

func (AlgorithmName) Equal

func (an AlgorithmName) Equal(other AlgorithmName) bool

func (AlgorithmName) Key

func (an AlgorithmName) Key() string

func (AlgorithmName) Less

func (an AlgorithmName) Less(other AlgorithmName) bool

type AnalyticsCacheAlgorithm

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

func (*AnalyticsCacheAlgorithm) AddIndicatorAdaptor

func (ta *AnalyticsCacheAlgorithm) AddIndicatorAdaptor(adaptor indicator_adaptor.IndicatorAdaptor)

func (*AnalyticsCacheAlgorithm) CleanUp

func (ta *AnalyticsCacheAlgorithm) CleanUp()

func (*AnalyticsCacheAlgorithm) Evaluate

Evaluate evaluates the signals from all adaptors and determines the action

func (*AnalyticsCacheAlgorithm) Name

Name returns the name of the trading algorithm

type TradingAlgorithm

type TradingAlgorithm interface {
	Name() *AlgorithmIdentifier
	AddIndicatorAdaptor(indicator_adaptor.IndicatorAdaptor)
	Evaluate(ctx context.Context, data *model.DataPoint) model.StockAction
	CleanUp()
}

func NewAnalyticsCacheAlgorithm

func NewAnalyticsCacheAlgorithm(ctx context.Context, prefix string, adaptors []indicator_adaptor.IndicatorAdaptorCache, monitor monitor.Monitoring) TradingAlgorithm

Jump to

Keyboard shortcuts

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