Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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
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.
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 IRWithdrawal TransactionFees AdvisoryFee Redemption ExpiredTitle )
TransactionType codes for each type
func (TransactionType) String ¶
func (t TransactionType) String() string
Click to show internal directories.
Click to hide internal directories.