Closed leovinsen closed 4 years ago
Table mutual_funds_history {
id INTEGER PK AUTOINCREMENT,
product_id INTEGER FK NOT NULL,
amount DOUBLE NOT NULL,
datetime TEXT
}
sounds more fitting; amount can be positive or negative. To obtain the assets owned in a particular product, simply find by product id and calculate the amount.
Table mutual_funds_history {
id INTEGER PK AUTOINCREMENT,
product_id INTEGER FK NOT NULL,
amount DOUBLE NOT NULL,
datetime TEXT,
purchase_interval INT
}
ditambah interval untuk hitung interest
Interestnya cukup dibikin flat naik turun (misalnya +5% then -2.5%)
tombol sell dimatiin, tombol buy dinyalain, di bagian atas dikasi bagian "My Mutual Funds" yang berisi portfolio user, compounding interest
To calculate total assets, do a COUNT(amount), and each record will serve as a history, interest will be calculated as total of all records * interest
Or in sharedprefs