Backtesting not working for Bitget Linear (Futures) with 1d candles

When you try to backtest whatever strategy with 1d timeframe, you will have the error “parameter verification failed starttime || endtime” with Bitget Exchange (Linear), i.e. Futures.

Bug details:

Here is the response i have:

{
    "status": "NOTOK",
    "reason": "parameter verification failed starttime || endtime",
    "data": null,
    "timeProfile": {
        "balancerIncomingTime": 1744409773526,
        "balancerOutcomingTime": 1744409775071,
        "balancerRequestStartTime": 1744409773526,
        "balancerRequestEndTime": 1744409775071,
        "attempts": 1,
        "incomingTime": 1744409774402,
        "outcomingTime": 1744409775017,
        "inQueueStartTime": 1744409774402,
        "inQueueEndTime": 1744409774402,
        "exchangeRequestStartTime": 1744409774402,
        "exchangeRequestEndTime": 1744409774402
    }
}
  • [Optional] Steps to reproduce → Try to backtest any strategy/bot with 1d candles. As an example, i was following this video: https://youtu.be/ttLrZZnHB4c?t=881 for the pair OGUSDT on Bitget Futures. When adding the Combined Ratings on Interval 1day, then backtest, i got the error.

  • Expected result → Backtesting should work. The issue does not happen with 1h/4h/8h data candles.
    Thanks.

We have received your bug report regarding the backtesting issue with Bitget Linear (Futures) using 1d candles. Thank you for including the bot URL. We are aware of the issue and will provide an update shortly.

Also with 4h candles on Bitget, Period is set to “Auto” when backtesting a Trading Bot (so it should be around 3-4 months), it takes life to get the candles data, and when you look at the requests, for example:

https://api.gainium.io/candles?exchange=bitgetUsdm&symbol=OGUSDT&type=4H&startAt=1738310400000&endAt=1741154279000&limit=undefined

You see that in response you’re getting some 1m candles instead of 4h candles, for examples:

{
    "status": "OK",
    "data": [
        {
            "open": "3.5102",
            "high": "3.5118",
            "low": "3.5083",
            "close": "3.5118",
            "volume": "475.61883",
            "time": 1741142220000
        },
        {
            "open": "3.5118",
            "high": "3.5118",
            "low": "3.5097",
            "close": "3.5102",
            "volume": "247.45015",
            "time": 1741142280000
        },
        {
            "open": "3.5102",
            "high": "3.5158",
            "low": "3.5102",
            "close": "3.511",
            "volume": "168.24495",
            "time": 1741142340000
        },
...

1741142220000 => Wed Mar 05 2025 02:37:00 GMT+0000
1741142280000 => Wed Mar 05 2025 02:38:00 GMT+0000
1741142340000 => Wed Mar 05 2025 02:39:00 GMT+0000

My assumption was that each request is for a timeframe of 4h and in response we will get a granularity of 1m candes within this 4h timeframe, but the startAt attribute in your requests is not moving, e.g. :

https://api.gainium.io/candles?exchange=bitgetUsdm&symbol=OGUSDT&type=4H&startAt=1726790400000&endAt=1729007159000&limit=undefined
https://api.gainium.io/candles?exchange=bitgetUsdm&symbol=OGUSDT&type=4H&startAt=1726790400000&endAt=1728995099000&limit=undefined
https://api.gainium.io/candles?exchange=bitgetUsdm&symbol=OGUSDT&type=4H&startAt=1726790400000&endAt=1728983039000&limit=undefined
...

So i was wondering if we are not requesting multiple times the same candles data here.

Thank you for sharing the detailed information. The error you’re seeing is from Bitget’s API, which is not returning the expected data for daily candles. Unfortunately, the 1-day (1D) timeframe is currently unsupported for this exchange on Gainium due to API limitations. We’re in touch with Bitget to address this and will update the platform when a solution is available. In the meantime, shorter timeframes like 1h, 4h, or 8h should work correctly. We appreciate your understanding and patience!

1 Like