Documentation
¶
Overview ¶
Package client provides user interaction. Convenience methods are functional and have tests.
Index ¶
- func NewArchive(ctx context.Context, logger *log.Logger, pool *pgxpool.Pool, options ...Option) (*archive, <-chan error)
- func SyncDates(x TimeSeries, y TimeSeries)
- func WithActive(Active bool) func(*archive)
- func WithMinAge(MinAge time.Time) func(*archive)
- type AssetID
- type Option
- type PricedAsset
- type TimeSeries
- type TimeSeriesAsset
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 ¶
WithMinAge filters result set of assets that have no records before `MinAge`
Types ¶
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
Click to show internal directories.
Click to hide internal directories.