hello support,
strategy scenario :
when signal buy occur the strategy open 3 position with label : long1, long2, long3 in a same time with same sl and 3 different tp.
i want to change my stoploss of the long2 when the tp of long1 is reached and change my stoploss of the long3 when the tp of long2 is reached.
i try to change my stoploss values as :
public void setStopLossPips(double stopLossPips) throws JFException {
Instrument instr = order.getInstrument();
double currentStopLoss = order.getStopLossPrice();
if (order.isLong()){
if(order.getLabel().equals("long1") && order.getState() == IOrder.State.CLOSED){
if(order.getLabel().equals("long2")){
double newStopLoss = currentStopLoss + toPrice (generalPips, order.getInstrument());
newStopLoss = round(newStopLoss, order.getInstrument());
if(newStopLoss != currentStopLoss) {
order.setStopLossPrice(newStopLoss);
print("nsl:" + newStopLoss + "csl:" + currentStopLoss);
}
}
}
}
}
i think a have a problem with this part of code : if(order.getLabel().equals("long1") && order.getState() == IOrder.State.CLOSED)
but i don't understand why?
Can you shed some light on this?
eric