pvlib

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

README

pvlib

pvlib is a helper library for interfacing with the pv-api REST API. It provides go types for serializing to/from colfer and methods for uploading/downloading from pv-api.

usage

go get github.com/penny-vault/pvlib
pvlib.Authorize("<API Key>")
pvlib.FindPortfolio(pvlib.SearchCriteria{
    Name: "Name",
    Comparator: pvlib.EQUAL,
    StringValue: "My Portfolio"
})

Documentation

Index

Constants

View Source
const (
	SellTransaction     = "SELL"
	BuyTransaction      = "BUY"
	DividendTransaction = "DIVIDEND"
	SplitTransaction    = "SPLIT"
	DepositTransaction  = "DEPOSIT"
	WithdrawTransaction = "WITHDRAW"
	InterestTransaction = "INTEREST"
)

Variables

View Source
var (
	// ColferSizeMax is the upper limit for serial byte sizes.
	ColferSizeMax = 16 * 1024 * 1024
	// ColferListMax is the upper limit for the number of elements in a list.
	ColferListMax = 4 * 1024 * 1024
)

Colfer configuration attributes

Functions

func Authorize

func Authorize(myApiKey string)

Types

type AnnualReturn

type AnnualReturn struct {
	Year uint16

	Return float32
}

func (*AnnualReturn) MarshalBinary

func (o *AnnualReturn) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is portfolio.ColferMax.

func (*AnnualReturn) MarshalLen

func (o *AnnualReturn) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*AnnualReturn) MarshalTo

func (o *AnnualReturn) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*AnnualReturn) Unmarshal

func (o *AnnualReturn) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*AnnualReturn) UnmarshalBinary

func (o *AnnualReturn) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type ColferError

type ColferError int

ColferError signals a data mismatch as as a byte index.

func (ColferError) Error

func (i ColferError) Error() string

Error honors the error interface.

type ColferMax

type ColferMax string

ColferMax signals an upper limit breach.

func (ColferMax) Error

func (m ColferMax) Error() string

Error honors the error interface.

type ColferTail

type ColferTail int

ColferTail signals data continuation as a byte index.

func (ColferTail) Error

func (i ColferTail) Error() string

Error honors the error interface.

type CompareOperator

type CompareOperator string
const (
	Equal       CompareOperator = "eq"
	GreaterThan CompareOperator = "gt"
	LessThan    CompareOperator = "lt"
	Like        CompareOperator = "like"
)

type DrawDown

type DrawDown struct {
	Begin time.Time

	End time.Time

	Recovery time.Time

	LossPercent float64
}

func (*DrawDown) MarshalBinary

func (o *DrawDown) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is portfolio.ColferMax.

func (*DrawDown) MarshalLen

func (o *DrawDown) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*DrawDown) MarshalTo

func (o *DrawDown) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*DrawDown) Unmarshal

func (o *DrawDown) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*DrawDown) UnmarshalBinary

func (o *DrawDown) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type Holding

type Holding struct {
	Date time.Time

	Ticker string

	Shares float64
}

func (*Holding) MarshalBinary

func (o *Holding) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is portfolio.ColferMax.

func (*Holding) MarshalLen

func (o *Holding) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*Holding) MarshalTo

func (o *Holding) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*Holding) Unmarshal

func (o *Holding) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*Holding) UnmarshalBinary

func (o *Holding) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type Justification

type Justification struct {
	Key string

	Value float64
}

func (*Justification) MarshalBinary

func (o *Justification) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is portfolio.ColferMax.

func (*Justification) MarshalLen

func (o *Justification) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*Justification) MarshalTo

func (o *Justification) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*Justification) Unmarshal

func (o *Justification) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*Justification) UnmarshalBinary

func (o *Justification) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type Metrics

type Metrics struct {
	AlphaSinceInception float64

	AvgDrawDown float64

	BestYear *AnnualReturn

	BetaSinceInception float64

	DownsideDeviationSinceInception float64

	ExcessKurtosisSinceInception float64

	FinalBalance float64

	SharpeRatioSinceInception float64

	Skewness float64

	SortinoRatioSinceInception float64

	StdDevSinceInception float64

	TotalDeposited float64

	TotalWithdrawn float64

	UlcerIndexAvg float64

	UlcerIndexP50 float64

	UlcerIndexP90 float64

	UlcerIndexP99 float64

	WorstYear *AnnualReturn

	DynamicWithdrawalRateSinceInception float64

	PerpetualWithdrawalRateSinceInception float64

	SafeWithdrawalRateSinceInception float64
}

func (*Metrics) MarshalBinary

func (o *Metrics) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is portfolio.ColferMax.

func (*Metrics) MarshalLen

func (o *Metrics) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*Metrics) MarshalTo

func (o *Metrics) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*Metrics) Unmarshal

func (o *Metrics) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*Metrics) UnmarshalBinary

func (o *Metrics) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type Performance

type Performance struct {
	PortfolioID []byte

	PeriodStart time.Time

	PeriodEnd time.Time

	ComputedOn time.Time

	CurrentAssets []*ReportableHolding

	Measurements []*PerformanceMeasurement

	DrawDowns []*DrawDown

	PortfolioReturns *Returns

	BenchmarkReturns *Returns

	PortfolioMetrics *Metrics

	BenchmarkMetrics *Metrics
}

func (*Performance) MarshalBinary

func (o *Performance) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.CurrentAssets will be replaced with a new value. All nil entries in o.Measurements will be replaced with a new value. All nil entries in o.DrawDowns will be replaced with a new value. The error return option is portfolio.ColferMax.

func (*Performance) MarshalLen

func (o *Performance) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*Performance) MarshalTo

func (o *Performance) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.CurrentAssets will be replaced with a new value. All nil entries in o.Measurements will be replaced with a new value. All nil entries in o.DrawDowns will be replaced with a new value.

func (*Performance) Unmarshal

func (o *Performance) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*Performance) UnmarshalBinary

func (o *Performance) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type PerformanceMeasurement

type PerformanceMeasurement struct {
	Time time.Time

	Value float64

	BenchmarkValue float64

	RiskFreeValue float64

	StrategyGrowthOf10K float64

	BenchmarkGrowthOf10K float64

	RiskFreeGrowthOf10K float64

	Holdings []*ReportableHolding

	Justification []*Justification

	TotalDeposited float64

	TotalWithdrawn float64
	// Time-weighted rate of return
	TWRROneDay float32

	TWRRWeekToDate float32

	TWRROneWeek float32

	TWRRMonthToDate float32

	TWRROneMonth float32

	TWRRThreeMonth float32

	TWRRYearToDate float32

	TWRROneYear float32

	TWRRThreeYear float32

	TWRRFiveYear float32

	TWRRTenYear float32
	// Money-weighted rate of return
	MWRROneDay float32

	MWRRWeekToDate float32

	MWRROneWeek float32

	MWRRMonthToDate float32

	MWRROneMonth float32

	MWRRThreeMonth float32

	MWRRYearToDate float32

	MWRROneYear float32

	MWRRThreeYear float32

	MWRRFiveYear float32

	MWRRTenYear float32
	// active return
	ActiveReturnOneYear float32

	ActiveReturnThreeYear float32

	ActiveReturnFiveYear float32

	ActiveReturnTenYear float32
	// alpha
	AlphaOneYear float32

	AlphaThreeYear float32

	AlphaFiveYear float32

	AlphaTenYear float32
	// beta
	BetaOneYear float32

	BetaThreeYear float32

	BetaFiveYear float32

	BetaTenYear float32
	// ratios
	CalmarRatio float32

	DownsideDeviation float32

	InformationRatio float32

	KRatio float32

	KellerRatio float32

	SharpeRatio float32

	SortinoRatio float32

	StdDev float32

	TreynorRatio float32

	UlcerIndex float32
}

func (*PerformanceMeasurement) MarshalBinary

func (o *PerformanceMeasurement) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Holdings will be replaced with a new value. All nil entries in o.Justification will be replaced with a new value. The error return option is portfolio.ColferMax.

func (*PerformanceMeasurement) MarshalLen

func (o *PerformanceMeasurement) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*PerformanceMeasurement) MarshalTo

func (o *PerformanceMeasurement) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Holdings will be replaced with a new value. All nil entries in o.Justification will be replaced with a new value.

func (*PerformanceMeasurement) Unmarshal

func (o *PerformanceMeasurement) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*PerformanceMeasurement) UnmarshalBinary

func (o *PerformanceMeasurement) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type PerformanceMeasurementItem

type PerformanceMeasurementItem struct {
	Time time.Time

	Value1 float64

	Value2 float64
}

func (*PerformanceMeasurementItem) MarshalBinary

func (o *PerformanceMeasurementItem) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is portfolio.ColferMax.

func (*PerformanceMeasurementItem) MarshalLen

func (o *PerformanceMeasurementItem) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*PerformanceMeasurementItem) MarshalTo

func (o *PerformanceMeasurementItem) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*PerformanceMeasurementItem) Unmarshal

func (o *PerformanceMeasurementItem) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*PerformanceMeasurementItem) UnmarshalBinary

func (o *PerformanceMeasurementItem) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type PerformanceMeasurementItemList

type PerformanceMeasurementItemList struct {
	Items []*PerformanceMeasurementItem

	FieldNames []string
}

func (*PerformanceMeasurementItemList) MarshalBinary

func (o *PerformanceMeasurementItemList) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Items will be replaced with a new value. The error return option is portfolio.ColferMax.

func (*PerformanceMeasurementItemList) MarshalLen

func (o *PerformanceMeasurementItemList) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*PerformanceMeasurementItemList) MarshalTo

func (o *PerformanceMeasurementItemList) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Items will be replaced with a new value.

func (*PerformanceMeasurementItemList) Unmarshal

func (o *PerformanceMeasurementItemList) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*PerformanceMeasurementItemList) UnmarshalBinary

func (o *PerformanceMeasurementItemList) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type Portfolio

type Portfolio struct {
	ID []byte

	UserID string

	Name string

	StartDate time.Time

	EndDate time.Time

	Benchmark string

	StrategyShortcode string

	StrategyArguments string

	Schedule string

	Notifications int32

	Transactions []*Transaction

	CurrentHoldings []*Holding

	PredictedAssets *PortfolioHoldingItem
}

func Get

func Get(id []byte) (*Portfolio, error)

func (*Portfolio) DownloadOrders

func (p *Portfolio) DownloadOrders(transactions []*Transaction) error

DownloadOrders retrieves the list of orders that should be executed on the account

func (*Portfolio) MarshalBinary

func (o *Portfolio) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Transactions will be replaced with a new value. All nil entries in o.CurrentHoldings will be replaced with a new value. The error return option is portfolio.ColferMax.

func (*Portfolio) MarshalLen

func (o *Portfolio) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*Portfolio) MarshalTo

func (o *Portfolio) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Transactions will be replaced with a new value. All nil entries in o.CurrentHoldings will be replaced with a new value.

func (*Portfolio) Unmarshal

func (o *Portfolio) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*Portfolio) UnmarshalBinary

func (o *Portfolio) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

func (*Portfolio) UploadTransactions

func (p *Portfolio) UploadTransactions(transactions []*Transaction) error

UploadTransactions uploads the provided transactions to the portfolio

type PortfolioHoldingItem

type PortfolioHoldingItem struct {
	Time time.Time

	Holdings []*ReportableHolding

	Justification []*Justification

	PercentReturn float64

	Value float64

	Predicted bool
}

func (*PortfolioHoldingItem) MarshalBinary

func (o *PortfolioHoldingItem) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Holdings will be replaced with a new value. All nil entries in o.Justification will be replaced with a new value. The error return option is portfolio.ColferMax.

func (*PortfolioHoldingItem) MarshalLen

func (o *PortfolioHoldingItem) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*PortfolioHoldingItem) MarshalTo

func (o *PortfolioHoldingItem) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Holdings will be replaced with a new value. All nil entries in o.Justification will be replaced with a new value.

func (*PortfolioHoldingItem) Unmarshal

func (o *PortfolioHoldingItem) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*PortfolioHoldingItem) UnmarshalBinary

func (o *PortfolioHoldingItem) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type PortfolioHoldingItemList

type PortfolioHoldingItemList struct {
	Items []*PortfolioHoldingItem
}

func (*PortfolioHoldingItemList) MarshalBinary

func (o *PortfolioHoldingItemList) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Items will be replaced with a new value. The error return option is portfolio.ColferMax.

func (*PortfolioHoldingItemList) MarshalLen

func (o *PortfolioHoldingItemList) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*PortfolioHoldingItemList) MarshalTo

func (o *PortfolioHoldingItemList) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Items will be replaced with a new value.

func (*PortfolioHoldingItemList) Unmarshal

func (o *PortfolioHoldingItemList) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*PortfolioHoldingItemList) UnmarshalBinary

func (o *PortfolioHoldingItemList) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type PortfolioTransactionList

type PortfolioTransactionList struct {
	Items []*Transaction
}

func (*PortfolioTransactionList) MarshalBinary

func (o *PortfolioTransactionList) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Items will be replaced with a new value. The error return option is portfolio.ColferMax.

func (*PortfolioTransactionList) MarshalLen

func (o *PortfolioTransactionList) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*PortfolioTransactionList) MarshalTo

func (o *PortfolioTransactionList) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Items will be replaced with a new value.

func (*PortfolioTransactionList) Unmarshal

func (o *PortfolioTransactionList) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*PortfolioTransactionList) UnmarshalBinary

func (o *PortfolioTransactionList) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type ReportableHolding

type ReportableHolding struct {
	Ticker string

	Shares float64

	PercentPortfolio float32

	Value float64
}

func (*ReportableHolding) MarshalBinary

func (o *ReportableHolding) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is portfolio.ColferMax.

func (*ReportableHolding) MarshalLen

func (o *ReportableHolding) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*ReportableHolding) MarshalTo

func (o *ReportableHolding) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*ReportableHolding) Unmarshal

func (o *ReportableHolding) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*ReportableHolding) UnmarshalBinary

func (o *ReportableHolding) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type Returns

type Returns struct {
	MWRRSinceInception float64

	MWRRYTD float64

	MWRROneYear float64

	MWRRThreeYear float64

	MWRRFiveYear float64

	MWRRTenYear float64

	TWRRSinceInception float64

	TWRRYTD float64

	TWRROneYear float64

	TWRRThreeYear float64

	TWRRFiveYear float64

	TWRRTenYear float64
}

func (*Returns) MarshalBinary

func (o *Returns) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is portfolio.ColferMax.

func (*Returns) MarshalLen

func (o *Returns) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*Returns) MarshalTo

func (o *Returns) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*Returns) Unmarshal

func (o *Returns) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*Returns) UnmarshalBinary

func (o *Returns) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

type SearchCriteria

type SearchCriteria struct {
	Name        *string
	StringValue *string
	IntValue    *int
	Comparator  CompareOperator
}

type Transaction

type Transaction struct {
	ID []byte

	Cleared bool

	Commission float64

	CompositeFIGI string

	Date time.Time

	Justification []*Justification

	Kind string

	Memo string

	Predicted bool

	PricePerShare float64

	Shares float64

	Source string

	SourceID string

	Tags []string

	TaxDisposition string

	Ticker string

	TotalValue float64
}

func (*Transaction) MarshalBinary

func (o *Transaction) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Justification will be replaced with a new value. The error return option is portfolio.ColferMax.

func (*Transaction) MarshalLen

func (o *Transaction) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is portfolio.ColferMax.

func (*Transaction) MarshalTo

func (o *Transaction) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Justification will be replaced with a new value.

func (*Transaction) MarshalZerologObject

func (t *Transaction) MarshalZerologObject(e *zerolog.Event)

func (*Transaction) Unmarshal

func (o *Transaction) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, portfolio.ColferError and portfolio.ColferMax.

func (*Transaction) UnmarshalBinary

func (o *Transaction) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, portfolio.ColferError, portfolio.ColferTail and portfolio.ColferMax.

Jump to

Keyboard shortcuts

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