This paper presents a method for microgrid energy optimization with reliability and economy considered at the same time. The optimum operation capacity and power supply strategy are proposed for different kinds of micro-source with the annual total cost being minimum, which is the tradeoff between the cost of outage loss and that of investment and operation. By taking into account the source output characteristic, the random demand, exchange power between microgrid and network, reliability model of load, the cost of outage loss is calculated statistically based on the sequential Monte Carlo simulation method. And considering the micro-source operation condition and fixed number of years of microgrid operation, the cost of investment and operation based on the whole life cycle of microgrid is calculated. The optimal operation scheme is studied under a microgrid system in the autonomous mode. Results show that the method is capable of finding the optimal deployment and dynamic economical operation of the micro-source, reducing the total cost of the system.