Hello,
I would like know how the pending orders are processed. For example, when I send SELLSTOP with slippage and there will be only partial fill of this order.
Then I have 2 orders? First one is still pending order (SELLSTOP which wasn't executed yet) and second is executed part of this sellstop?
If yes, the labels of these orders are same (same as I set into submit method)?
OrderCommand of executed part is a SELL? I need know, how I can recognize executed part of order when I pass list of orders.
I trail my SL each tick in my way and I noticed that there can occur this thing:
I move SL by this way
if(order.getStopLossPrice()>normalize(tick.getAsk()+(iSL*selectedInstrument.getPipValue()))){
order.setStopLossPrice(normalize(tick.getAsk()+(iSL*selectedInstrument.getPipValue())));
print("SHORT SL modification "+normalize(tick.getAsk()+(iSL*selectedInstrument.getPipValue())));
}
But when I get new tick which have higher Ask than previous tick and previous modification wasn't done yet, then I send next modification but I shouldn't send this request because my previous modification was below.
Here is a log of second modification when it set higher SL and there was error:
10:30:03:299 => -onTick(GBP/USD,1.5652/1.5644, spread: 8)
10:30:03:299 => SHORT SL modification
1.565710:30:03:533 => -onTick(GBP/USD,1.56555/1.564, spread: 15)
10:30:03:533 => SHORT SL modification
1.566110:30:03:580 => -onMessage(MessageType ORDER_CHANGED_OK Text null Related order [GDP2]-FILLED/GBP/USD/0.175)
10:30:03:596 => -onMessage(MessageType ORDER_CHANGED_OK Text null Related order [GDP2]-FILLED/GBP/USD/0.175)
Is there any way how I can send modification and wait for result?
Thanks DarkMan