Hi all, I’m having some trouble setting up several target profits in the same automated trading. The idea is to decrease the target profits the longer a trade is on market, so my code looks like this: if longonmarket and barindex - tradeindex(1) <= 1 then SET TARGET $PROFIT 50 elsif longonmarket and barindex - tradeindex(1) > 1 and barindex - tradeindex(1) <= 3 then SET TARGET $PROFIT 30 elsif barindex - tradeindex(1) > 3 then sell at market endif Set stop ploss 20 Only thing is, this doesn’t seem to be working in backtesting Any ideas? Thanks.