We formulate and analyze a profit maximization problem for one participant (aggregator) in a multiperiod electricity market with the consideration of profit fluctuations caused by uncertain photovoltaics (PV) output. We first introduce an aggregator's prosumption model, whereby an energy demand/supply profile can be achieved by adjusting the dispatchable devices, e.g., energy storage management systems and fossil fuel generators. Then, the uncertainty issue stemming from the PV profiles is handled by a classical stochastic programming framework and a robust optimization framework. A dispatchable tuning cost function is discussed based on the two frameworks above, and the distribution of the particular cost is analyzed. The simulation results show that although both of the two frameworks are able to overcome the PV uncertainty, an average strategy gives a higher expected value of profits with a higher risk (a larger variance) while a worst-case strategy gives a lower expected value of profits with a smaller risk.