Open GoogleCodeExporter opened 8 years ago
What's about something like :
int currentPosition = getPositionManager().getPosition();
double lastEntry = getPositionManager().getAvgFillPrice();
if(currentPosition <= 0 && ...) {
cancelAllStops();
setPosition(1);
setStopSell(lastEntry - 5);
}
if(currentPosition >= 0 && ...) {
cancelAllStops();
setPosition(-1);
setStopBuy(lastEntry + 5);
}
Original comment by Robertde...@gmail.com
on 25 May 2008 at 11:58
Yes, something like that, although it's probably better to handle it with the
"One
cancels others" type of order:
http://individuals.interactivebrokers.com/en/trading/orders/oca.php
Original comment by eugene.k...@gmail.com
on 25 May 2008 at 9:38
Original comment by eugene.k...@gmail.com
on 29 Aug 2008 at 2:41
Original issue reported on code.google.com by
eugene.k...@gmail.com
on 23 Feb 2008 at 5:31