SL devation too high

Bug info: Stop Loss order taking too long till execution.

In my bot i have a stop loss target of -21.5%.
On last deal, Gainium SL was triggered at 20:45:07 but order filled 22s later at 20:45:07.

Price also was lower 21seconds before

Why does it takes that long to react on the exchange?
Deal was closed with -35% and that is not very accurate to SL Target of -21.5%

All the backtesting is useless with such high devations in real trading.

I know, leverage is high but it shouldn’t take 43 seconds from real trigger price to sell order to close a deal??

Is there any possibility to calculate the SL price after max. DCA has reached and send the SL order to exchange?

  • Bot URL → Gainium app
  • [Optional] Steps to reproduce →
  • Expected result →

Okay, had the same issue again with another bot.

It Triggered the start of the deal and it took 20seconds till buy order executed. Same with stop loss trigger. Ended up in Liquidation after 12 seconds, gainium did not react at all!!!

Messed up many trades in a higher loss as it should, and also had some liquidations.

20 seconds latency is way too much for crypto.

Need to stop all bots for now till clarification and I know how we can lower latency. 1 or 2 seconds are okay but not 20.

I really like Gainium and I don’t want to leave, but it seems it is the wrong tool for me.

Need to test it directly via webhook/bybit how long it takes to open/close deals.
Is API the problem???

Thx for feedback.

We have had a lot of volatility in the past few days, and when that happens, many potential issues can cause a delay:

  • Gainium will be slower to react due to the large amount of signals fired
  • Due to the large number of incoming orders, the exchange will be slower in accepting them and replying to Gainium with confirmation.
  • Some orders may have to wait in a queue, as each exchange limits the number of orders we can send per minute.

SL orders are actually market orders. Sending SL as limit in advance require another kind of order that not every exchange accept and it would need some time for testing as those are important changes to the core logic that everything is based on.

I will talk to the dev to see if we can do something to avoid the delay or if is feasible to integrate SL as limit.

Actually, scratch that. I thought it was a DCA bot. For combo, we have no other option than executing the SL at market because the bot must cancel the grid before selling the base. Furthermore, Bybit doesn’t have a queue system. Maksym checked, and there was a delay in the exchange response; the first order took 15 seconds to send a confirmation, and the second took 2 seconds. At 50x, the price difference gets multiplied by the leverage, so the final P&L could be quite different from the originally intended.

I would recommend using less leverage.

But that also means, the backtests using a high leverage are not accurate at all and therefore the strategy wont work by using gainium or any other crypto bot using api access?

Is there a way to reduce the latency for example by setting up the strategy directly in bybit via webhook or programming the bot in another way?

I just don’t want to give up these strategies just by limitations of gainium or the API.

A backtest is not an accurate representation of the past, information is lost with candles even on the smallest time frame. Backtesting is just one of the tool to test strategy, you also have paper trading and live trading with small capital. Of those three only the live trading with small capital will be accurate. The other two have their own limitation, and the differences between their result and the actual result gets multiplied by the leverage.

There is no other way to make it faster, at least not from our side. Bybit took a while to send confirmation, that was the problem.