I'm trying to use the ATR in SetProfitTarget.
My code snippet for this is:
SetProfitTarget(Position.AvgPrice +(ATR(14)[1])*2);
In plain language, I'm trying to set a profit target 2* the ATR above my entry price. However, in backtesting, I am getting orders executed at a price of ATR(14)[1]*2, instead of adjusted by this amount from my entry price. Any ideas on what's going wrong here?
Thank you

Comment