Documentation
¶
Index ¶
- Constants
- func Deserialize(ctx context.Context, data string, monitoring monitor.Monitoring) (indicator_adaptor.IndicatorAdaptor, error)
- func GetUpdatedCommonLabelsContext(ctx context.Context, name string) context.Context
- func PutEvaluateResponse(signal *model.TradingSignal)
- type AlgorithmIdentifier
- type AlgorithmName
- type AnalyticsCacheAlgorithm
- func (ta *AnalyticsCacheAlgorithm) AddIndicatorAdaptor(adaptor indicator_adaptor.IndicatorAdaptor)
- func (ta *AnalyticsCacheAlgorithm) CleanUp()
- func (ta *AnalyticsCacheAlgorithm) Evaluate(ctx context.Context, data *model.DataPoint) model.StockAction
- func (ta *AnalyticsCacheAlgorithm) Name() *AlgorithmIdentifier
- type TradingAlgorithm
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 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 ¶
func (ta *AnalyticsCacheAlgorithm) Evaluate(ctx context.Context, data *model.DataPoint) model.StockAction
Evaluate evaluates the signals from all adaptors and determines the action
func (*AnalyticsCacheAlgorithm) Name ¶
func (ta *AnalyticsCacheAlgorithm) Name() *AlgorithmIdentifier
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
Click to show internal directories.
Click to hide internal directories.