portfolio

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrettyString added in v1.2.0

func GetPrettyString(v interface{}) string

Types

type Asset

type Asset struct {
	Alloc    string `json:"allocation"`
	Currency string `json:"currency"`

	Fxr         string `json:"exchangeRate"`
	MarketValue string `json:"marketValue"`
	Name        string `json:"name"`
	Order       *order `json:"order,omitempty"`
	Price       string `json:"price"`
	Qty         string `json:"quantity"`
	Type        string `json:"type"`
	// contains filtered or unexported fields
}

type AssetGroup

type AssetGroup map[string]Asset

TODO: Convert to struct and include total market value field

type AssetRebalance

type AssetRebalance struct {
	Source AssetGroup `json:"source"`
	Target AssetGroup `json:"target"`
}

type Portfolio

type Portfolio struct {
	Api    api.StockApi
	Assets AssetRebalance `json:"assets"`
	// contains filtered or unexported fields
}

func NewPortfolio

func NewPortfolio(filename, apiKey, apiServer, oauthCredsFile string, oauthRefresh bool, currency string) (*Portfolio, error)

func (*Portfolio) Rebalance

func (p *Portfolio) Rebalance() error

Jump to

Keyboard shortcuts

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