I wrote a system and I'd like to apply a profit target, not a static one based on fixed nr of pips, but proportional to the ATR.
To do so, after my conditions to enter/exit trades, I wrote:
// Condition set 3
if (Close[0] > Position.AvgPrice * (1 + ATR(14)[0]))
{
ExitLong("TAKEPROFIT", " BUY");
}
It doesn't work though, like if those lines were not present, the system trades regardless.
What did I forget please?
Any help greatly appreciated

Comment