Knowing When to Stop Matters: A Unified Algorithm for Online Conversion under Horizon Uncertainty

Yanzhao Wang, Hasti Nourmohammadi Sigaroudi, Bo Sun, Omid Ardakanian, Xiaoqi TanarXiv 2025 · DOI

Researchers from the University of Alberta and the University of Waterloo have introduced a new framework for Online Conversion (OC), a fundamental problem in algorithmic trading and resource management. Whether selling stocks or discharging an electric vehicle (EV) battery into the grid, the objective remains constant: maximize profit by selling a fixed resource over time steps with unpredictable prices.

The core innovation lies in addressing "horizon uncertainty"—the varying degrees of knowledge regarding when a trading window will close—while incorporating realistic physical constraints.

Bridging the Gap: Box Constraints and Horizon Uncertainty

In the classic OC problem, a player sells $k$ units over $T$ steps. However, existing models often suffer from two major limitations. First, they assume the time horizon $T$ is either perfectly known or completely unknown, ignoring intermediate "notified" or "predicted" scenarios. Second, they frequently overlook "box constraints," which are physical rate limits (e.g., a battery's maximum discharge rate).

Comparison of this work with existing literature across different horizon scenarios and box constraints.

As shown in the table above, this paper provides a unified treatment that covers all horizon scenarios while accounting for box constraints, establishing tight or optimal competitive ratios where previous work left gaps.

The PseudoMax Algorithm

The researchers propose PseudoMax, a unified algorithm designed to achieve optimal competitive guarantees across these diverse scenarios. Its architecture rests on three technical pillars:

  1. Pseudo-Cost Functions: Instead of a static price threshold, PseudoMax calculates a "marginal value" for the remaining resource that adapts based on previous trades.
  2. Online Primal-Dual (OPD) Framework: This framework links the resource's perceived value to market prices, ensuring the algorithm maintains a specific "competitive ratio" (CR)—the worst-case performance gap compared to an omniscient offline optimizer.
  3. Two-Phase Trading: To handle rate limits, the algorithm utilizes a "proactive phase" for opportunistic selling and a "forced phase" triggered by "laxity"—a measure of how much time remains before the algorithm must sell at the maximum rate to deplete the resource.

For predicted horizons, a learning-augmented component splits the resource into two virtual buckets: one optimized for the AI prediction and another managed with a "safety-first" approach for robustness.

Theoretical Performance and Sensitivity

A key contribution of this work is the establishment of the first tight competitive ratio for the OC problem with a known horizon and non-trivial box constraints. The performance of the algorithm is sensitive to several parameters, including the length of the horizon ($T$), the strictness of the rate limits ($b$), and the price fluctuation ratio ($\theta$).

Competitive Ratio (CR) sensitivity to time horizon (T), box constraints (b), and price fluctuation ratio (theta).

The analysis reveals that as the time horizon $T$ increases, the performance gap between "Known" and "Notified" settings narrows. This suggests that even a short-term warning before the horizon ends is highly valuable for long-term trading strategies.

Real-world Application: Vehicle-to-Grid (V2G)

The framework was validated using a case study in V2G energy trading, utilizing high-frequency price data from the PJM market (August 2024) and technical specifications for a Tesla Model 3. The simulations demonstrated that the unified algorithm consistently outperformed traditional threshold-based baselines while respecting the physical discharge limits of the battery.

One notable insight from the learning-augmented model is that underestimating the horizon is generally safer than overestimating it. Overestimation can lead the algorithm to hold out for "peak" prices that never materialize before the window closes, whereas underestimation ensures resources are sold at reasonable prices earlier.

Conclusion and Future Directions

The PseudoMax framework bridges the gap between theoretical robustness and practical engineering requirements. While currently focused on one-way conversion (selling), future work aims to extend this to bi-directional trading (arbitrage) and incorporate factors like transaction costs and battery degradation.

Summary updated

BibTeX
@misc{wang2025knowing,
  author = {Yanzhao Wang and Hasti Nourmohammadi Sigaroudi and Bo Sun and Omid Ardakanian and Xiaoqi Tan},
  title = {{Knowing When to Stop Matters: A Unified Algorithm for Online Conversion under Horizon Uncertainty}},
  year = {2025},
  eprint = {2502.03817},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.03817},
}
Figure