Profit stats / initial purchase price incorrect after stop / start bot

Bug info: I use a grid bot. According to the stats it has today 21.35 dollar profit. But it had only 20 sell orders of around 13.6 dollar.

I see that the purchase is incorrect. I stopped the bot and cancelled all the orders. And started the bot again. The purchase price in the bot says 4.354, on the exchange 4.709. I think the amount of 4.354 is the initial price. So it didn’t update the new base purchase price. So the profit stats aren’t correct.

  • Bot URL → Gainium app
  • Expected result → lower profit

For the profit amount, you cannot calculate it that way. Sell orders without a matching grid buy will be matched to the initial price, so the profit per sell is not always the same.

Can you show a screenshot of the exchange details you mentioned?

Okx

In the bot it also says start order.

But I stopped and started the bots a few times. Maybe therefor the wrong start price.

I’m sorry I am not seeing the issue, the fill price and fill quantity on the exchange is the same as the base order of the bot. What’s the problem?

The initial purchase price is different. I thought that this is incorrect. Because the purchase price was different(after restart).

Thank you for reporting this behavior. This is actually designed intentionally. When you stop and restart the bot, it calculates the base order price based on all filled buy orders made by the bot, not just the initial one. This method allows for a more accurate calculation of the average purchase price of the base asset. This ensures that the bot can make trading decisions based on the true average cost.

1 Like

Aah ok, thank for the info.

This bug can be closed.