?whatIf
This commit is contained in:
@@ -73,6 +73,11 @@
|
|||||||
<input name="predictFixedGrowth" type="text" value="VBTLX=0.02&predictFixedGrowth=GLD=0.02&predictFixedGrowth=FXAIX=0.03&predictFixedGrowth=FSPSX=0.03"/>
|
<input name="predictFixedGrowth" type="text" value="VBTLX=0.02&predictFixedGrowth=GLD=0.02&predictFixedGrowth=FXAIX=0.03&predictFixedGrowth=FSPSX=0.03"/>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
<label for="whatIf">whatIf</label>
|
||||||
|
<input name="whatIf" type="text" value="AssetAccount:Cash $ -1.00"/>
|
||||||
|
</span>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<input type="submit"/>
|
<input type="submit"/>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -93,11 +93,31 @@ func main() {
|
|||||||
foolike = like
|
foolike = like
|
||||||
}
|
}
|
||||||
|
|
||||||
register := deltas.Like(foolike...).Register()
|
deltas := deltas.Like(foolike...)
|
||||||
|
|
||||||
|
// MODIFIERS
|
||||||
|
for i, whatIf := range r.URL.Query()["whatIf"] {
|
||||||
|
fields := strings.Fields(whatIf)
|
||||||
|
date := "2001-01"
|
||||||
|
name := fields[0]
|
||||||
|
currency := ledger.Currency(fields[1])
|
||||||
|
value, err := strconv.ParseFloat(fields[2], 64)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
deltas = append(deltas, ledger.Delta{
|
||||||
|
Date: date,
|
||||||
|
Name: name,
|
||||||
|
Value: value,
|
||||||
|
Currency: currency,
|
||||||
|
Description: fmt.Sprintf("?whatIf[%d]", i),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
register := deltas.Register()
|
||||||
predicted := make(ledger.Register)
|
predicted := make(ledger.Register)
|
||||||
bpis := maps.Clone(bpis)
|
bpis := maps.Clone(bpis)
|
||||||
|
|
||||||
// MODIFIERS
|
|
||||||
if predictionMonths, err := strconv.ParseInt(r.URL.Query().Get("predictionMonths"), 10, 16); err == nil && predictionMonths > 0 {
|
if predictionMonths, err := strconv.ParseInt(r.URL.Query().Get("predictionMonths"), 10, 16); err == nil && predictionMonths > 0 {
|
||||||
window := time.Hour * 24.0 * 365.0 / 12.0 * time.Duration(predictionMonths)
|
window := time.Hour * 24.0 * 365.0 / 12.0 * time.Duration(predictionMonths)
|
||||||
// TODO whatif
|
// TODO whatif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
todo:
|
todo:
|
||||||
- predictWhatIf=2023-10=AssetAccount:Cash=$=-7000 changes too much when removing 7k
|
|
||||||
from prinicple
|
|
||||||
- html version can accept new transactions for moolah
|
- html version can accept new transactions for moolah
|
||||||
scheduled: []
|
scheduled: []
|
||||||
done:
|
done:
|
||||||
@@ -64,3 +62,6 @@ done:
|
|||||||
ts: Fri Oct 27 19:53:44 MDT 2023
|
ts: Fri Oct 27 19:53:44 MDT 2023
|
||||||
- todo: ana/predictor for bpi or de-legacy
|
- todo: ana/predictor for bpi or de-legacy
|
||||||
ts: Fri Oct 27 19:53:44 MDT 2023
|
ts: Fri Oct 27 19:53:44 MDT 2023
|
||||||
|
- todo: predictWhatIf=2023-10=AssetAccount:Cash=$=-7000 changes too much when removing
|
||||||
|
7k from prinicple
|
||||||
|
ts: Fri Oct 27 20:37:12 MDT 2023
|
||||||
|
|||||||
Reference in New Issue
Block a user