Is it safe to modify stop loss orders via cAlgo API?

Created at 16 Feb 2015, 15:26
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CP

cprcrack

Joined 15.02.2015

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.


@cprcrack
Replies

Spotware
18 Feb 2015, 12:40

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?

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

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

kricka
21 Feb 2015, 00:56

Hi,

have not inured it so far, an invalid stop loss. Maybe this behavior can happen if the stop loss is modified within the spread? So far had no problems with changing the stop loss.  


@kricka

Spotware
25 Feb 2015, 17:07

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?

Yes, exactly.


@Spotware