-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
30 lines (27 loc) · 1.31 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package fin
import "time"
type Aggregate struct {
Symbol string
Name string
ShareCount float64
AvgPrice float64
PriceCurrency string // currency that goes with avg price; EUR, USD, GBX
ShareCost float64 // amount of money spent on this stock, based on the stock's currency. Only used for avg price
ShareCostLocal float64 // amount of money spent on this stock, based on the portfolio's currency
ShareResult float64 // amount of money received from selling
TotalDividend float64 // amount of money received from dividends
Fees float64 // FXFee, FRFee, StampDutyTax
Final float64 // Result + Dividends, minus Cost and Fees.
LastUpdate time.Time // used internally to deal with splits
}
type Totals struct {
Deposits float64 // the money you deposited
Invested float64 // the money you have invested, minus fees
Realized float64 // gains you have realized by selling
Dividends float64 // amount of money you received from dividends
Fees float64 // fees you paid
Withdrawals float64 // costs that are taken away from your cash i.e. Card debit
Cash float64 // cash left in your portfolio
Taxes float64 // taxes withheld from dividends
Interest float64 // interest you received on cash, lent shares or card cashback
}