Close an open position with fixed amount of pips

Posted By wah_castle Friday, May 10, 2013
Add to Favorites0
Author Message
wah_castle
 Posted Friday, May 10, 2013
Supreme Being

Supreme Being - (356 reputation)Supreme Being - (356 reputation)Supreme Being - (356 reputation)Supreme Being - (356 reputation)Supreme Being - (356 reputation)Supreme Being - (356 reputation)Supreme Being - (356 reputation)Supreme Being - (356 reputation)Supreme Being - (356 reputation)

Group: Forum Members
Last Active: Friday, May 10, 2013
Posts: 1, Visits: 2
356
Hi, I want to ask whether we can use script to monitor an open position and close it with a certain amount of pips away from the enter bar? Thanks a lot.
Cannibal
 Posted Tuesday, May 21, 2013
Supreme Being

Supreme Being - (2,365 reputation)Supreme Being - (2,365 reputation)Supreme Being - (2,365 reputation)Supreme Being - (2,365 reputation)Supreme Being - (2,365 reputation)Supreme Being - (2,365 reputation)Supreme Being - (2,365 reputation)Supreme Being - (2,365 reputation)Supreme Being - (2,365 reputation)

Group: Forum Members
Last Active: Tuesday, July 23, 2013
Posts: 8, Visits: 58
Hello wah_castle,try to use something like this


procedure OnNewRate;
var
i: Integer;
ThisTrade: TTrade;
begin
for i := TradeList.Count-1 downto 0 do
begin
ThisTrade := TradeList.Get(i);
if ThisTrade.BuySell = bsSell then
begin
if ThisTrade.CloseRate <= ThisTrade.OpenRate - CertainAmountOfPips * ThisTrade.Instrument.PointSize then
CloseTrade(ThisTrade, ThisTrade.Amount, TraderRange, ThisTrade.Tag);
end
else
begin
if ThisTrade.CloseRate >= ThisTrade.OpenRate + CertainAmountOfPips * ThisTrade.Instrument.PointSize then
CloseTrade(ThisTrade, ThisTrade.Amount, TraderRange, ThisTrade.Tag);
end;
end;
end;


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top