def _refresh_candles(candle: dict, candlelist: list[dict], max_len: int = 10000) -> tuple[list[dict], bool]:
    """Recieve candlestick data and append to candlestick list if it is new candlestick."""
    changed = False
    if candle['k']['x']:
        if candlelist:
            if candle['k']['t'] != candlelist[-1]['t']:
                candlelist.append(candle['k'])
                changed = True
                if len(candlelist) > max_len:
                    candlelist.pop(0)
        else:
            candlelist.append(candle['k'])
            changed = True
    return candlelist, changed