Algorithm to decide on electricity price is high or low based on historical prices

Reading this thread for the first time. While I’d like to restate that being able to retrieve the median is a prerequisite to many algorithms - so the feature request is well worth implementing -, it’s no good solution in this use case.

You may know or not that I’ve built and am commercially selling an energy management system that optimizes power cost with dynamic tariffs just like you attempt here.

Thing now is, from my experience of operating the system for more than a year, there’s no price patterns you should rely on. That means you should not deduce from historic data if today’s pricing distribution and in particular the level is high or low. Doing so will drive you into trouble one way or the other. Plus, the median really isn’t a meaningful figure in this case either.

Without that I want to advertise my product, be warned that developing a good algorithm and even more so a proper implementation of that is hard, there’s lots of pitfalls.

Ultimately, what my system does and how it computes “high” or “low” is documented here:
https://storm.house/docs/#Energieniveaumanagement (German)

On the algorithm, there have been extensive discussions in this thread I’d recommend to read

and this

1 Like