v1.0.6 Latest Latest

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

Go to latest
Published: Dec 10, 2019 License: GPL-3.0 Imports: 12 Imported by: 0




This section is empty.


This section is empty.


func Signin

func Signin(username string, password string) (err error)


type Application

type Application struct {
	Date            time.Time
	ApplicationDate time.Time
	Type            TransactionType
	Investment      string
	Quantity        float64
	Price           float64
	IR              float64
	Net             float64

Application represents buy/sell transaction

func Applications

func Applications() (applications []Application, err error)

func (Application) Excel

func (a Application) Excel() string

Excel prints the Application type as an spreedshet line separated by tabs.

func (Application) String

func (a Application) String() string

type Asset

type Asset struct {
	Amount             string
	AssetID            int    `json:"asset_id"`
	AssetReturn        string `json:"asset_return"`
	CategoryKey        string `json:"category_key"`
	InstrumentTypeName string `json:"instrument_type_name"`
	Issuer             string
	Liquidity          int
	MaturityDate       string `json:"maturity_date"`
	Name               string
	Yield              string

An Asset is an investment acquired for the account

func Assets

func Assets(userID string) (assets []Asset, err error)

type Equity

type Equity struct {
	Time  time.Time // Day when the value was measured
	Value string    // Amount of money

An Equity represents the amount of money if all of the assets were liquidated.

func (Equity) Excel

func (e Equity) Excel() string

Excel prints an equity as two excel cells separated by tabs \t

func (Equity) String

func (e Equity) String() string

type EquityCurve

type EquityCurve struct {
	Equities []Equity

An EquityCurve holds a slice of Equity

func GetEquityCurve

func GetEquityCurve(userID string) (curve *EquityCurve, err error)

func (EquityCurve) Len

func (e EquityCurve) Len() int

func (EquityCurve) Less

func (e EquityCurve) Less(i, j int) bool

func (EquityCurve) Swap

func (e EquityCurve) Swap(i, j int)

type InvestmentPlan

type InvestmentPlan struct {
	Age               int
	GoalValue         float64 `json:"goal_value,string"`
	InitialInvestment float32 `json:"initial_investment,string"`
	MonthlyInvestment float32 `json:"monthly_investment,string"`
	PeriodInYears     int     `json:"period_in_years"`
	RiskLevel         int     `json:"risk_level"`

An InvestmentPlan holds the original plan for the magnetis account plan

func GetInvestmentPlan

func GetInvestmentPlan(userID string) (plan *InvestmentPlan, err error)

type TransactionType

type TransactionType int

TransactionType represents which transactions was performed with an Asset

const (
	MoneyApplication TransactionType = iota

TransactionType codes for each type

func (TransactionType) String

func (t TransactionType) String() string

Jump to

Keyboard shortcuts

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