Page 1 of 1

Dollar Trailing

Posted: Feb 23 2009
by Thomas Mann
Hi,
I am having a issue with the auto trail command listed below. I asked a question the other day about it but never got an answer so I decided to try again.
When the code listed below triggers I am seeing the Auto trader try to exit the position as expected, but it tries as much as currentask +1 so it never fills on the current bar. Is there a way to tell it to do a market cover order ?
Thanks

if openpositionprofit >= 1 then // This means the profit is >= 1 point
begin

setstopposition;
setdollartrailing(.25);

end;

Posted: Feb 24 2009
by Marina Pashkova
Hi Thomas,

Your question is not quite clear. Could you please provide more details on what it is you think is being done wrong?

As for the code that you posted, we have some comments on that.

----------------------------------

if openpositionprofit >= 1 then // This means the profit is >= 1 point

The above line does not mean that the profit is >=1 point. You will need to write the line as:

if openpositionprofit >= 1 point then //


This is when profit is >=1 point.

--------------------------------------

begin
setstopposition;
setdollartrailing(.25); // The value is indicated in dollars. If you want to indicate it in points, you need to write

setdollartrailing(.25*pointvalue);
end;

Posted: Feb 25 2009
by Thomas Mann
Hi Marina,
Thanks for clarifying that for me. I will play with it some more and see if I can get it to work better. Is there any way to tell a strategy to exit a trade at market this bar ?
Thanks