Energy allocation with risk management in electricity markets