Problem
report.edge_table and report.accumulation_table (added in #825) key each row by f"{rule.name}:{asset}". Two rules of the same kind on the same asset map to one key, and the later rule silently overwrites the earlier one.
Seen in practice. ~/keel/keel.db has two paper DCA rules on BTC-USD: rule 19 with budget_usd: 50 and rule 20 with budget_usd: 5.0. A 5-year keel simulate on v0.18.0 prints one accumulation row:
| Rule |
Buys |
Cost basis |
Value |
| dca:BTC |
261 |
$1,321.31 |
$2,571.50 |
That is rule 20 alone: 261 × $5 plus fees. Rule 19's $50 sleeve, about 10× larger, appears nowhere. Anyone reading the row sees a ~$5/week DCA and draws the wrong conclusion about the $50 rule.
The same keying in edge_table means two turtle_breakout rules on one asset (for example, two parameter sets) would lose a per-rule row. The pooled row is not affected: edge_table extends the pool with every rule's trades before keying.
Fix
Key rows so they are unique per rule. For example, include rule.rule_id when two rules share name:asset, or always as name#id:asset. The table must render every rule. Tests first: two DCA rules on one asset give two rows whose buys and cost match each rule's own budget; two turtle rules on one asset give two edge rows; the pooled row is unchanged.
Problem
report.edge_tableandreport.accumulation_table(added in #825) key each row byf"{rule.name}:{asset}". Two rules of the same kind on the same asset map to one key, and the later rule silently overwrites the earlier one.Seen in practice.
~/keel/keel.dbhas two paper DCA rules on BTC-USD: rule 19 withbudget_usd: 50and rule 20 withbudget_usd: 5.0. A 5-yearkeel simulateon v0.18.0 prints one accumulation row:That is rule 20 alone: 261 × $5 plus fees. Rule 19's $50 sleeve, about 10× larger, appears nowhere. Anyone reading the row sees a ~$5/week DCA and draws the wrong conclusion about the $50 rule.
The same keying in
edge_tablemeans twoturtle_breakoutrules on one asset (for example, two parameter sets) would lose a per-rule row. The pooled row is not affected:edge_tableextends the pool with every rule's trades before keying.Fix
Key rows so they are unique per rule. For example, include
rule.rule_idwhen two rules sharename:asset, or always asname#id:asset. The table must render every rule. Tests first: two DCA rules on one asset give two rows whose buys and cost match each rule's own budget; two turtle rules on one asset give two edge rows; the pooled row is unchanged.