PRICE-02: the trading verdict skips price periods that have ended #206

Merged
admin merged 6 commits from PRICE-02 into release/1.0 2026-10-22 18:57:38 +02:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit 6b2d0091d6 - Show all commits
@@ -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.
+3 -1
View File
@@ -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(