We present the closed-form solution to the problem of hedging price and quantity risks for energy retailers (ER), using financial instruments based on electricity price and weather indexes. Our model considers an ER who is intermediary in a regulated electricity market. ERs buy a fixed quantity of electricity at a variable cost and must serve a variable demand at a fixed cost. Thus ERs are subject to both price and quantity risks. To hedge such risks, an ER could construct a portfolio of financial instruments based on price and weather indexes. We construct the closed form solution for the optimal portfolio for the mean-Var model in the discrete setting. Our model does not make any distributional assumption.