Then you need one variable storing the price level of each new open trade open. Then recalculate the potential noew proce to trigger the conditions you need and repeat again when that price is hit. Obviously those variables will have to be carefully reset in order to avoid miscalculations.