Derive the (start_dl, end_dl) string pair for an ENTSO-E download.
Computes the date window needed to cover train_years of history plus a start_margin_days buffer on the left, and optionally a caller-supplied upper bound on the right. All computation is pure (no network, no filesystem access).
Reference point for the window, typically pd.Timestamp.now(tz="UTC"). Must be a pd.Timestamp — coercion is intentionally refused to prevent silent mistakes with string arguments.
Extra days prepended to the window so that the training data survives the downstream lag-feature creation step. Defaults to 45. Must be a non-negative int (bools rejected).
Upper bound of the window in 'YYYYMMDDHHMM' format, or None (the default) to set the end to now + 2 days (i.e. today + tomorrow + one additional day — the standard day-ahead horizon). When provided, the value is validated strictly; any deviation from the format raises ValueError.