This work, co-authored by Dr. Marcos.-J Rider and Ms. Cristina Corchero and submitted to the journal Annals of Operations Research, developed a stochastic programming model that integrated the most recent regulation rules of the Spanish peninsular system for bilateral contracts in the day-ahead optimal bid problem. This model allows a price-taker generation company to decide the unit commitment of the thermal and combined cycle programming units, the economic dispatch of the bilateral contracts between all the programming units and the optimal sale bid by observing the Spanish peninsular regulation. See the full text at http://hdl.handle.net/2117/2282