Following situation, i buy a security with a minimum stop distance of say 10 points. Then i want to use “set stop ploss 10” to set my stop loss. The commands are right after eachother in my code. Now my bot generate a buysignal to buy at market on the next candle. The bot buys but experience some slippage so the actual candle is trading below the buy-price. Then tries my bot to set the stop loss 10 points below my buy-price but because the current candle trades lower the stop order is rejected because it is closer than the 10 points minstopdistance. This happens 12 times (12 seconds in a row) and the whole trade is canceled.
How can one approach this problem. We always only get the info from the last candle but not the current that is in the making, am i right? So how can one avoid this rejection-problem. Of course setting a much wider stop would solve the problem but is there a better solution?