performance

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

type Calculator struct {
	Context   journal.Context
	Valuation *journal.Commodity
	Filter    journal.Filter
}

Calculator calculates portfolio performance

func (Calculator) Perf

func (calc Calculator) Perf(ctx context.Context, inCh <-chan *val.Day) (<-chan *PerfPeriod, <-chan error)

Perf computes portfolio performance.

type PerfPeriod

type PerfPeriod struct {
	Date                                                     time.Time
	V0, V1, Inflow, Outflow, InternalInflow, InternalOutflow pcv
	Err                                                      error
}

PerfPeriod represents monetary values and flows in a period.

func (PerfPeriod) Performance

func (dpv PerfPeriod) Performance() float64

Performance computes the portfolio performance.

Jump to

Keyboard shortcuts

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