A discrete-time algorithm for pricing double barrier options