Is it safe to modify stop loss orders via cAlgo API?
Is it safe to modify stop loss orders via cAlgo API?
16 Feb 2015, 15:26
Suppose my bot is going long (bought), currently profiting, and places a stop loss on price X, but later it decides to move the stop loss to price X+10. Is this operation safe or is it possible that while the stop loss is being "moved" upwards, the price decreases to X+5 and thus the stop loss is never hit and I end up without any protection? Or is this something you already take care of not happening?
Or in other words, what happens if by the time the stop loss order modification reaches the server, the current price is bellow the stop loss order? Does it get fired automatically? Does it return an error?
I hope I was able to describe the situation, let me know if you need me to clarify the question even more.
Replies
cprcrack
19 Feb 2015, 13:22
I understand that if the stop loss is invalid it won't be applied, but here I'm talking about a modification of a currently valid stop-loss order. Do you mean that if the stop loss modification is not valid, it will return that error and the previous price of the stop loss will be kept?
@cprcrack
Spotware
18 Feb 2015, 12:40
If SL will be invalid it will not be applied. You will receive TRADING_BAD_STOPS error. You can easily check this behavior using Demo account.
@Spotware