Hi Seem to be unable to fathom this one out can anyone help? The following is stopping me out on the same candle as entry I’m sure its something simple and the code could be simplified:- // first stops if longonmarket THEN DIFF = (close-Tenkansen)*pointsize sl = (close-Tenkansen)*pointsize set stop ploss sl endif if shortonmarket THEN DIFF = (tenkansen-close)*pointsize sl = (tenkansen-close)*pointsize set stop ploss sl endif // dynamic change of stops if longonmarket then dynamicsl = sl if (DIFF > dynamicsl) then dynamicsl = DIFF endif endif if shortonmarket then dynamicsl = sl if (DIFF > dynamicsl) then dynamicsl = DIFF endif endif