In this paper, a stochastic model is presented to investigate arbitrage between the day-ahead market (DAM) and the imbalance market (IM) for electricity considering uncertainty of prices. The revenue of arbitrage is calculated for a type of flow batteries, namely Hydrogen-Bromine (HBr) batteries. In order to model uncertainty, scenarios are generated by analyzing the real electricity prices. The required number of scenarios is determined through an iterative algorithm that adds scenarios in each iteration until the normalized change in revenue is less than the predefined value. The simulation is done based on the Dutch DAM and IM electricity prices and revenues are calculated for HBr batteries with different parameters. Also, the investment cost, operation cost, and the connection cost are compared with the calculated revenues and an estimation of the gained profit is reported.