filters

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: GPL-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 Filter

type Filter interface {
	// contains filtered or unexported methods
}

Filter interface defines a filter's methods processing trades from the tradesBlockService.

type FilterMA

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

FilterMA is the struct for a moving average filter implementing the Filter interface.

func NewFilterMA

func NewFilterMA(asset dia.Asset, exchange string, currentTime time.Time, param int) *FilterMA

NewFilterMA returns a moving average filter. @currentTime is the begin time of the filtersBlock.

func (*FilterMA) Compute added in v1.2.0

func (s *FilterMA) Compute(trade dia.Trade)

func (*FilterMA) FilterPointForBlock added in v1.2.0

func (s *FilterMA) FilterPointForBlock() *dia.FilterPoint

func (*FilterMA) FinalCompute added in v1.2.0

func (s *FilterMA) FinalCompute(t time.Time) float64

type FilterMAIR

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

FilterMAIR implements a trimmed moving average. Outliers are eliminated using interquartile range. see: https://en.wikipedia.org/wiki/Interquartile_range

func NewFilterMAIR

func NewFilterMAIR(asset dia.Asset, exchange string, currentTime time.Time, memory int) *FilterMAIR

NewFilterMAIR returns a FilterMAIR

func (*FilterMAIR) Compute added in v1.2.0

func (s *FilterMAIR) Compute(trade dia.Trade)

func (*FilterMAIR) FilterPointForBlock added in v1.2.0

func (s *FilterMAIR) FilterPointForBlock() *dia.FilterPoint

func (*FilterMAIR) FinalCompute added in v1.2.0

func (s *FilterMAIR) FinalCompute(t time.Time) float64

type FilterMEDIR

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

FilterMEDIR contains the configuration parameters of the filter. It implements a trimmed median. Outliers are eliminated using interquartile range see: https://en.wikipedia.org/wiki/Interquartile_range

func NewFilterMEDIR

func NewFilterMEDIR(asset dia.Asset, exchange string, currentTime time.Time, memory int) *FilterMEDIR

NewFilterMEDIR creates a FilterMEDIR

type FilterTLT

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

func NewFilterTLT

func NewFilterTLT(asset dia.Asset, exchange string) *FilterTLT

type FilterVOL

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

func NewFilterVOL

func NewFilterVOL(asset dia.Asset, exchange string, memory int) *FilterVOL

type FilterVWAP added in v1.2.0

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

FilterVWAP ...

func NewFilterVWAP added in v1.2.0

func NewFilterVWAP(asset dia.Asset, exchange string, currentTime time.Time, param int) *FilterVWAP

NewFilterVWAP ...

func (*FilterVWAP) Compute added in v1.2.0

func (s *FilterVWAP) Compute(trade dia.Trade)

Compute ...

func (*FilterVWAP) FilterPointForBlock added in v1.2.0

func (s *FilterVWAP) FilterPointForBlock() *dia.FilterPoint

FilterPointForBlock ...

func (*FilterVWAP) FinalCompute added in v1.2.0

func (s *FilterVWAP) FinalCompute(t time.Time) float64

FinalCompute ...

type FilterVWAPIR added in v1.2.0

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

FilterVWAP ...

func NewFilterVWAPIR added in v1.2.0

func NewFilterVWAPIR(asset dia.Asset, exchange string, currentTime time.Time, param int) *FilterVWAPIR

NewFilterVWAP ...

func (*FilterVWAPIR) Compute added in v1.2.0

func (s *FilterVWAPIR) Compute(trade dia.Trade)

Compute ...

func (*FilterVWAPIR) FilterPointForBlock added in v1.2.0

func (s *FilterVWAPIR) FilterPointForBlock() *dia.FilterPoint

FilterPointForBlock ...

func (*FilterVWAPIR) FinalCompute added in v1.2.0

func (s *FilterVWAPIR) FinalCompute(t time.Time) float64

FinalCompute ...

type FiltersBlockService

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

FiltersBlockService is the data structure containing all objects necessary for the processing of a tradesBlock.

func NewFiltersBlockService

func NewFiltersBlockService(previousBlockFilters []dia.FilterPoint, datastore models.Datastore, chanFiltersBlock chan *dia.FiltersBlock) *FiltersBlockService

NewFiltersBlockService returns a new FiltersBlockService and runs mainLoop() in a go routine.

func (*FiltersBlockService) Close

func (s *FiltersBlockService) Close() error

Close gracefully closes the Filtersblockservice

func (*FiltersBlockService) ProcessTradesBlock

func (s *FiltersBlockService) ProcessTradesBlock(tradesBlock *dia.TradesBlock)

ProcessTradesBlock sends a filled tradesBlock into the filtersBlock channel.

Jump to

Keyboard shortcuts

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