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.
Click to show internal directories.
Click to hide internal directories.