def get_klines_snapshot(self):
    '返回当前klines的切片数据'
    try:
        d = {'strategy': self.strategy_name, 'datetime': datetime.now()}
        klines = {}
        for kline_name in sorted(self.klines.keys()):
            klines.update({kline_name: self.klines.get(kline_name).get_data()})
        kline_names = list(klines.keys())
        binary_data = zlib.compress(pickle.dumps(klines))
        d.update({'kline_names': kline_names, 'klines': binary_data, 'zlib': True})
        return d
    except Exception as ex:
        self.write_error(f'获取klines切片数据失败:{str(ex)}')
        return {}
返回当前klines的切片数据
def get_klines_snapshot(self):
    
    try:
        d = {'strategy': self.strategy_name, 'datetime': datetime.now()}
        klines = {}
        for kline_name in sorted(self.klines.keys()):
            klines.update({kline_name: self.klines.get(kline_name).get_data()})
        kline_names = list(klines.keys())
        binary_data = zlib.compress(pickle.dumps(klines))
        d.update({'kline_names': kline_names, 'klines': binary_data, 'zlib': True})
        return d
    except Exception as ex:
        self.write_error(f'获取klines切片数据失败:{str(ex)}')
        return {}