Skip to content
All library documents

Backtesting Strategies Across Day-Ahead and Real-Time Electricity Markets

Article Quant Q&A · Author: rgalbo

Summary

The note describes a backtesting challenge in electricity markets where a strategy buys in the day-ahead market and sells in the real-time market the following day. These trades refer to distinct price series and settlement times, so frameworks designed around a single asset series may require adaptation to represent the position and its later exit correctly.

The accepted response points to backtrader’s spot and day-ahead pattern as a framework feature intended for this type of timing structure, with related documentation and a discussion of power futures settlement. This is a practical pointer rather than a worked implementation: the note provides no code, performance results, or details about handling market-specific settlement rules, transaction costs, or data alignment. Users would need to check that the framework setup matches the strategy and market being modeled.

Key ideas

  • A day-ahead purchase and a later real-time sale require a backtest to track two price series.
  • The gap between entry and exit timing must be represented in the backtesting framework.
  • The response identifies backtrader’s spot/day-ahead pattern as relevant to energy-market tests.
  • The note does not provide an implementation or evidence about strategy performance.

Tags

Full text
# Dual Settlement Market Backtesting and Analysis


# Dual Settlement Market Backtesting and Analysis












An interesting problems I have been dealing with as a relatively new quant to the Electricity markets is the difficulty of back testing.

The issues I have been having with backtesting are that the framework needs to be able to work over two series, a purchase in the day ahead market and a sale in the real time market 24hr after. some of the backtesting frameworks like bt and backtrader work great for normal single series models but don't hold up for a double series market, atleast with out significant customization which may be the fastest route.

Wondering if anyone has encountered a similar problem?

## Answer by mementum (score 1, accepted)

https://quant.stackexchange.com/a/35223

`backtrader` supports the spot/day-ahead pattern, which was developed explicity for energy markets. See

- https://www.backtrader.com/blog/posts/2017-03-15-future-vs-spot/future-vs-spot.html

- https://community.backtrader.com/topic/221/power-futures-settlement

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.