From 6b2d0091d6ead5b376b80d0afa654e3e5d50942b Mon Sep 17 00:00:00 2001 From: glenn schrooyen Date: Thu, 22 Oct 2026 16:48:43 +0200 Subject: [PATCH] PRICE-02 review: keep an open buy over midnight in the real-year replay; say which variant the kWh figure is The production-shaped plan sees tomorrow from 13:00, so most buys are sold the next day or later. The ledger forgot the open buy at each midnight and booked 46 of 51 sales as holdings: 5 trips, +1.21 EUR. Carried over, the same decisions give 51 trips, +13.81 EUR, all clearing the threshold. Decisions are unchanged and identical on the old and new verdict. No assertion changed. DECISIONS: 27.5 -> 42.6 kWh is the refresh-:00, tomorrow-known variant; give the range of the other three. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC --- .../DECISIONS/PRICE-02-the-verdict-skips-ended-periods.md | 8 +++++--- goodwe_controller/test_arbitrage.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/goodwe_controller/DECISIONS/PRICE-02-the-verdict-skips-ended-periods.md b/goodwe_controller/DECISIONS/PRICE-02-the-verdict-skips-ended-periods.md index 0583b76..e95b443 100644 --- a/goodwe_controller/DECISIONS/PRICE-02-the-verdict-skips-ended-periods.md +++ b/goodwe_controller/DECISIONS/PRICE-02-the-verdict-skips-ended-periods.md @@ -80,8 +80,10 @@ tested the first of them only because its plan began at midnight. On real 15-minute days the trade runs longer: about 1.5 to 2.5 times the minutes spent charging or discharging, with fewer on/off switches (for example -78 -> 68, 92 -> 72). Through a modelled 10 kWh battery that is 27.5 -> 42.6 kWh -over 16 days (2026-09-02 to 09-17, a decision every minute, refresh at :00 or -:10, tomorrow's prices known always or from 13:00; reviewer's sim). Charge to +78 -> 68, 92 -> 72), over 16 days (2026-09-02 to 09-17, a decision every +minute, refresh at :00 or :10, tomorrow's prices known always or from 13:00; +reviewer's sim). Through a modelled 10 kWh battery that is 27.5 -> 42.6 kWh +(refresh at :00, tomorrow always known); 19.6-31.9 -> 43.4-48.7 kWh in the +other three variants. Charge to discharge reversals are unchanged (10 -> 10, 13 -> 13). More cycling is the price of not pausing. diff --git a/goodwe_controller/test_arbitrage.py b/goodwe_controller/test_arbitrage.py index ddb21e0..4c72d1f 100644 --- a/goodwe_controller/test_arbitrage.py +++ b/goodwe_controller/test_arbitrage.py @@ -2093,12 +2093,14 @@ def replay_real(days, threshold, unc, *, soc0=50.0, floor=20.0, ceiling=95.0): it and never a day on its own. (An earlier version built one plan per calendar day with no tomorrow: after the cheap hour no cheap hour was left ahead, and the ledger shrank to a few trades that no real site would see.) + An open buy is kept over midnight: with tomorrow in view most buys are + sold the next day or later (46 of 51 at the shipped threshold). """ soc = soc0 trades, holdings, bad, neg_sells = [], [], [], 0 + open_buy = None for di, day in enumerate(days): nxt = days[di + 1] if di + 1 < len(days) else [] - open_buy = None for i, p in enumerate(day): ahead = day[i:] + (nxt if brussels(p.start).hour >= 13 else []) plan = TariffPlan(