However I'm struggling to bring in a basic ATR trailing stop. I have got ATR*2 and converted it to a number representing $10 per pip and then set that using SetDollarTrailing.
For each successive bar I am trying to move the stop to represent the new ATR*2 but it doesn't seem to be moving it properly and it often moves a lot higher than it should be.
An abbreviated version of the code is:
Code: Select all
longStop = (atr*2)/.0001;
if marketposition = 1 then
begin
setdollartrailing(longStop);
end;