Traling stop loss moves down with a decreasing price

Bug info:In teh information about “trailing stop loss” I read:

What is a Trailing Stop Loss

Trailing stop loss is a popular trading technique that enables you to follow the trend. The principle behind it is simple: the trailing stop loss moves in the direction of your take profit, and it’s always spaced the same percentage from the best price.

“it’s always spaced the same from the best price

This is however not the case.
I did set the trailing stop loss to 4% and the initial stop loss value was set to 2.577 but when the price eventually went down to 2.543 the stop loss was lowered to 2.539, where it stayed when the price went up again. The bot also did a sell/and/buy at 19:23:50 at $ 2.627.

When I wasn’t even close to the computer (eating dinner).

  • Bot URL → Gainium app
  • [Optional] Steps to reproduce →
  • Expected result → Since the price went under 2.577 the bot should have sold.

It seems like it is not the moving stop loss that is the problem but the fact that the bot sells for no apparent reason.
I ran basically the same bot on a different coin and got this:


while I was out of the house (I started the bot and left) and it almost directly sold, and since the bot has an ASAP-start it bought again.

Still the same bot but now on SUSHI, closed it self after 4 minutes and 5%.

Thank you for reporting this issue with the trailing stop loss moving down with the decreasing price. Our development team will check the bug and address it shortly.

This morning I ran a backtest on the bot that sold after 4 minutes while I was gone and even the backtest sold after 4 minutes so there is something I don’t understand.
https://app.gainium.io/bot/new?load=6755adb10134c0adc55c4c10&share=null&backtest=run

The lowest price of LQTYUSDT was 2.5747. The trailing level depends on the actual deal start price, which may differ slightly from the estimation displayed during bot creation or editing. This is normal and doesn’t indicate any issue.

The HIVE deals were not closed due to trailing take profit but because the bot controller determined that the coin’s price fell below the stop condition of 3.6 USDT. As the coin price was significantly lower, the bot correctly closed the deals and stopped.

The SUSHI deal was closed due to trailing take profit as expected. This behavior aligns with the configured strategy, and everything seems to be functioning as intended.

Wasn’t trailing SL set at % on highest price?

Den mån 9 dec. 2024 19:07Fahri via Gainium Community <[email protected]> skrev:

The trailing stop loss starts based on your initial price. It will follow the price up in that distance.

That regards to SL, not trailing SL.

I don’t understand this answer.

If your trade starts at $100 and you have a TSL of %10, then the Stop Loss will start at $90. If the price goes up to $120, it will follow at the same distance as it was at the start, so it will be $110. If the price goes down again, the Stop Loss won’t move and should be executed when $110 is reached.

I was just watching a Trailing Stop Loss bot with the Stop Loss started at 0.4402 and then went up, and down, and down, and down from 0.4402 to 0.4355, and then up to 0.4402, and then back down to 0.4359 before it went up again.
https://app.gainium.io/bot/67602a7a576e87f617a410ec

The price went down from 0.4458 to 0.4392 which is 1.4% even though the TSL was set to 1%.

That’s really strange. I would expect a trailing stop loss to only follow into the direction of the deal’s take profit but not the other way round. Or could there be another reason for those movements?

I agree, but let’s ask @Aressanch