Added DB indexes and constraints. Calculating stop price.