In this paper, we propose an optimal bidding strategy for industrial combined heat and power (CHP) installations selling their power on multiple markets. This corresponds to the typical situation where power is traded on a day-ahead market (DAM) and a continuous intraday market (CIM). Each market has its own trading rules. The considered installations consist of a CHP, a conventional heating installation and a heat buffer. Each device has its own constraints, such as maximum and minimum deliverable heat and electrical power, and minimum and maximum buffer capacity. The objective is to determine the bidding strategy that will maximise the expected profit, while the future time evolution of both heat demand and market prices are unknown. To tackle this problem, we assume that the probability density functions (PDFs) of these variables are known or can be extracted from historical data. Then, by applying a tailored stochastic programming algorithm, the optimal bidding strategy can be constructed based on these PDFs and includes the different market rules and constraints on the installation. For a DAM, the bidding functions must be estimated in advance, which is a typical open-loop problem. On the other hand, the bidding functions for a CIM may be estimated almost in real time. This new scheme is exemplified for the Belgian market. Combining both markets can increase the expected profits significantly because risks due to uncertainties in heat demand are better controlled. Copyright © 2013 John Wiley & Sons, Ltd.