entities

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromEntitiesToMap

func FromEntitiesToMap(entities []SimpleMovingAverage) []map[string]interface{}

FromEntitiesToMap converts a list of entities to a map.

func FromEntityListToModelList

func FromEntityListToModelList(entities []SimpleMovingAverage) (*timeseries.TimeSerie[float64], error)

FromEntityListToModelList converts a list of entities to a timeserie.

Types

type SimpleMovingAverage

type SimpleMovingAverage struct {
	Exchange     string    `db:"exchange"`
	Pair         string    `db:"pair"`
	Period       string    `db:"period"`
	PeriodNumber int       `db:"period_number"`
	PriceType    string    `db:"price_type"`
	Time         time.Time `db:"time"`
	Data         []byte    `db:"data"`
}

SimpleMovingAverage is the entity for the simple moving average.

func FromModelListToEntityList

func FromModelListToEntityList(
	exchange, pair string,
	period period.Symbol,
	periodNb int,
	priceType candlestick.PriceType,
	ts *timeseries.TimeSerie[float64],
) ([]SimpleMovingAverage, error)

FromModelListToEntityList converts a timeserie to a list of entities.

func (*SimpleMovingAverage) FromModel

func (s *SimpleMovingAverage) FromModel(p sma.Point) error

FromModel converts the model to an entity.

func (SimpleMovingAverage) ToModel

func (s SimpleMovingAverage) ToModel() (sma.Point, error)

ToModel converts the entity to a model.

type SimpleMovingAverageData

type SimpleMovingAverageData struct {
	Price float64 `db:"price"`
}

SimpleMovingAverageData is the entity for the simple moving average data.

Jump to

Keyboard shortcuts

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