The aim of the paper is to study the optimal participation of wind energy in day ahead and intraday markets. Due to the intermittent nature and the low predictability of wind power, this participation may imply large deviations from the initial schedule, which lead to a cost that has to be borne by the wind farm owner. By means of short term wind power prediction programs, these losses may be reduced, and, if the market allows the possibility of updating previous bids at intraday markets, the total income of the wind producers can be increased by a significant percent. The paper shows the optimal strategies for maximizing the market participant revenue, using a wind power prediction tool and, optionally, a price prediction tool for an even better performance. It includes simulation results that have been obtained following the rules of the Spanish electricity markets.