client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package client provides user interaction. Convenience methods are functional and have tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewArchive

func NewArchive(ctx context.Context, logger *log.Logger, pool *pgxpool.Pool, options ...Option) (*archive, <-chan error)

NewArchive context and pool are mandatory.

func SyncDates

func SyncDates(x TimeSeries, y TimeSeries)

SyncDates drops the days that dont exist for both assets If y is nil nothing is done

func WithActive

func WithActive(Active bool) func(*archive)

WithActive filters all assets that are only historically listed - i.e. Mostly not at the stock market anymore.

func WithMinAge

func WithMinAge(MinAge time.Time) func(*archive)

WithMinAge filters result set of assets that have no records before `MinAge`

Types

type AssetID

type AssetID = db.AssetID

type Option

type Option func(*archive)

type PricedAsset

type PricedAsset = db.PricedAsset

type TimeSeries

type TimeSeries = db.TimeSeries

func Add

func Add(weights []float64, tslist ...TimeSeries) (TimeSeries, error)

Add adds many TimeSeries. Dates that don't exist for all series are dropped. If weights are nil they are set = 1. Weights don't need to be normalized.

type TimeSeriesAsset

type TimeSeriesAsset = db.TimeSeriesAsset

Jump to

Keyboard shortcuts

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