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;
Dollar Trailing
- Marina Pashkova
- Posts: 2758
- Joined: Jul 27 2007
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;
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;
-
- Posts: 173
- Joined: Aug 25 2007
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
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