I have a sample code to test the setPercentTrailing. The following is the code.
if date = 1110527 and time = 1137 then begin
buy ("test buy") 1 shares next bar market;
end;
if marketposition <> 0 then begin
setstopcontract;
setstoploss(500);
setpercenttrailing(200, 50);
end;
The symbol I used was +GC# from IQ feed (1 Gold contract with 100 X leverage). The entry price was at 1,535.8. The profit target was 200 dollars. The highest point was at 1539.50, so I would expect the position to be closed as soon as the low reached below 1538.5 (50% of 200 is 100 which is 1 point). However this didn’t happen and the trade triggered much later at 1,537.6. I have attached a screen shot. Please advise.
setPercentTrailing Question.
-
- Posts: 3
- Joined: 05 Jun 2010
setPercentTrailing Question.
- Attachments
-
- GC_setPercentTrailing.gif
- Trading Example
- (125.02 KiB) Downloaded 198 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: setPercentTrailing Question.
see post #3I have a sample code to test the setPercentTrailing. The following is the code.
if date = 1110527 and time = 1137 then begin
buy ("test buy") 1 shares next bar market;
end;
if marketposition <> 0 then begin
setstopcontract;
setstoploss(500);
setpercenttrailing(200, 50);
end;
The symbol I used was +GC# from IQ feed (1 Gold contract with 100 X leverage). The entry price was at 1,535.8. The profit target was 200 dollars. The highest point was at 1539.50, so I would expect the position to be closed as soon as the low reached below 1538.5 (50% of 200 is 100 which is 1 point). However this didn’t happen and the trade triggered much later at 1,537.6. I have attached a screen shot. Please advise.
viewtopic.php?f=16&t=6929