From 6f8d049a087523547f6f2a1cfff7ebec562d5871 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Fri, 27 Oct 2023 19:05:59 -0600 Subject: [PATCH] auto contributions only if at least 4 (3 deltas) in 6 months --- ana/predictor.go | 3 +++ todo.yaml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ana/predictor.go b/ana/predictor.go index c111f12..001a469 100644 --- a/ana/predictor.go +++ b/ana/predictor.go @@ -99,6 +99,9 @@ func getMonthlyAutoContributionRateForCurrency(contributions []ledger.Balance, w } } slices.Sort(values) + if len(values) < 3 { + return 0 + } start := int(len(values) / 4) end := min(1+max(0, len(values)-len(values)/4), len(values)) diff --git a/todo.yaml b/todo.yaml index 3b8fb12..3cc12f9 100755 --- a/todo.yaml +++ b/todo.yaml @@ -1,5 +1,4 @@ todo: -- require at least N contributions in N months before autoContributions!=0 - ?prediction=contributions=x y z&prediction=contribution=x y z - ana/predictor for bpi or de-legacy - predictWhatIf=2023-10=AssetAccount:Cash=$=-7000 changes too much when removing 7k @@ -61,3 +60,5 @@ done: ts: Fri Oct 27 18:49:37 MDT 2023 - todo: ana/legacy_* drop ts: Fri Oct 27 18:50:08 MDT 2023 +- todo: require at least N contributions in N months before autoContributions!=0 + ts: Fri Oct 27 19:05:40 MDT 2023