Python for Power Systems

A blog for power systems engineers to learn Python.

AEMO Settlement Date

Here’s a reminder of how to use the AEMO Settlement Date.

The settlement date is a day and time used in many of AEMO’s database tables. It’s a fundamental marker of time because it marks one of the 48 trading intervals.

Every half hour, AEMO generates a new electricity price that is used to bill customers and pay generators. There are 48 half hours in a day, each is called a trading interval.

So, the first Settlement Date, the one corresponding to trading interval one. What is that time?

You might be tempted to say 00:00 Hrs (morning midnight). However that time is tied to period 48 of the previous day.

The Settlement Date describes the end of the half hour trading interval. So the first half hour of the day is at Settlement Date 00:30 and consists of the half hour between 00:00 and 00:30.

For those of you that are keen to learn Python, here is a quick demonstration using the concept of settlement date.

settlementdate.py
1
2
3
4
5
6
7
8
9
10
11
import datetime

half_hour = datetime.timedelta(minutes=30)
trading_intervals = []

for interval in range(1, 49):
    settlement_date = datetime.datetime(2001, 1, 1) + interval * half_hour

    trading_intervals.append(settlement_date)

print trading_intervals

This short piece of code created a small calendar of 48 intervals for a single day. interval * half_hour is a clever trick we use to actually create the intervals. Multiply a half hour by 2 and you get 1 hour, and so on until multiplying by 48 gives 24 hours, the full day.

Hold on, did someone say 4am?

Yeah what’s up with that? In some parts of the documentation AEMO refers to the start of the trading day as 4am, with the first period at 04:30.

Well the notion of the 4am start comes from the National Electricity Rules:

Trading Days are effective from 04:00 to 04:00 am the next day, with period 1 at 04:30am

Settlement processes are calendar based and period 1 is at 00:30am as talked about in this post.

You’ll run across trading dates that start at 4am when you deal with bids and offers. But most other tables use the settlement_date field whose first period is 00:30am.

I hope that you are suitably confused.