Designing smart power trading algorithms
The student becomes the master: Designing smart power trading algorithms

Nobel Prize laureate Richard Feynman famously said, "If you want to master something, teach it." Feynman was not only a brilliant physicist but a master teacher, able to reduce complex topics into simple explanations that the average person can understand. He was so committed to this principle that he even defined a learning strategy known as the Feynman Technique. The heart of the technique is to explain a subject as if you were speaking to a child. As you do so, you’ll find gaps that you can’t explain well; study those gaps until you can explain them better.

Creating an algorithm for automated electricity trading is surprisingly similar. As an experienced trader, you rely on certain strategies in your trading. You’ve probably internalized them to the point that you can react to a wide variety of market situations intuitively. But the market is getting more complex in every measure: faster, more volatile, more products, more volume, more (smaller) trades. To stay competitive and achieve the next level in your trading operations, you need help. 

Algorithmic trading can support you, taking over the routine tasks of execution while you focus on making sense of the market and refining your strategies. This requires translating your knowledge into code - to make an algorithm smart enough that you can trust it to trade your positions independently on the intraday market. To accomplish this you’ll have to go back to the basics of your trading strategy and break it down into simple elements, so you can teach the algorithm to carry out your chosen approach.

 

How do you teach an algotrader?

Algorithmic trading and high-frequency trading are commonly used methodologies on intraday electricity markets, which has led to increasing attention around customizable automated trading solutions.

The heart of automated trading is the trading algorithm: a trading strategy transformed into code. In order to set up an automated strategy to trade power on the intraday market, decisions are necessary on the following dimensions: 

  • The total amount to sell or buy 
  • Optimal partitioning: breaking orders into smaller amounts
  • The prices of the orders 
  • The most appropriate time to place the orders 

For a power plant operator or a wholesale energy provider, the total amount to trade is usually driven by capacity or demand and is thus out of the trader’s (and thus also the algorithm’s) decision scope; it’s simply fed by forecasts. In the case of a trading organization, the amount is more variable, but minimum and maximum boundaries may be defined. 

The degree of partitioning is one element of a trading algorithm that will diverge from your typical manual trading strategy. While a human can only successfully manage a limited number of orders at one time, an automated trading solution can easily cope with a much larger number of orders, and so can break your open position into smaller orders. Generally speaking, partitioning the amount of energy to sell into smaller orders enables more adaptive pricing and thus the potential for greater profit. 

Once the amount to sell or buy is determined, i.e. the open positions are known for certain products on the market, it’s a matter of price and timing. You must define how orders are placed and kept in the order book, and when they should be resubmitted with another price. A strategy should consider the distribution of the orders both in time (to gate closure) and regarding the wind and solar production forecast or forecast error.

You can consider a strategy that involves keeping your own order on top of the order book, or near to the best priced orders currently on the market. While the best bid/ask price is acceptable through some predefined limiting constants (price ranges), it’s worth following the trend and changing your own orders accordingly. Here the main goal is to close the open positions, thus avoiding high imbalance fees charged by the TSO.

 

Learning to respect market limits

Generating orders with the best bid/ask price in the order book is an easy task for automated trading algorithms but some questions need to be properly considered. 

Many of the intraday exchange systems prevent API users from flooding the servers with unmanageable numbers of orders. This is accomplished through a limit on the order-to-trade ratio, which means that after a certain number of orders is created, no more orders can be posted to the market unless some of them are executed and result in a trade. 

With automated algorithms you can modify your own existing order’s price and amount, but technically, increasing the price or amount results in a newly created order by the exchange and the removal from the order book of the former order. 

So, it’s important to make sure if any action on the market is worth taking. One can consider a moment of time when there is a significant change in prices and market situation compared to their own order currently on the market, either on a proportional basis or a certain amount of price movement. Besides the difference between the current best bid/ask price on the market and your own order price, the historical data should be also considered; if there is a great difference between the historically predicted situation and the current market state, it can indicate particular trading opportunities which can be reflected in the algorithm.

Another indicator can be that the gate closure is near, as it’s obvious that trading activities increase at the last period of trading on a given product. Changing prices more frequently in this period is more feasible. Also, you can use a timing or aging constant to check whether a sufficient amount of time has passed after the previous action.

At an early stage of implementation you can tune the trading algorithm manually, based on predictions drawn from data as well as adjustments based on actual results. Advanced, more sophisticated implementation involves machine learning algorithms, such as artificial neural networks or regressions. Using historical data sets, the intelligent algorithms can be trained to predict future market situations and adjust their strategy.

 

From student to master

So, now you’ve created a smart trading algorithm. You can kick back and enjoy a well-deserved coffee break while your algorithm executes your strategy, trading smaller orders faster than you could yourself. 

But don’t get too comfortable too fast. Just as your manual trading strategies have constantly evolved over time, updating to new market conditions, your algorithm must evolve too. You now have a great opportunity: with all of the extra time you’ve gained, you can concentrate on watching the market, analyzing data and looking for new ways to improve and adapt your strategy. And as you continue to teach your algorithm to be smarter and smarter, you yourself can become a master at automated trading.