This commit is contained in:
lz_db
2025-12-04 19:44:22 +08:00
parent f85f4ef152
commit 8dc0f0dbc3
11 changed files with 1128 additions and 519 deletions

View File

@@ -2725,3 +2725,667 @@ KeyError: 'updated'
2025-12-04 15:32:23 | INFO | sync.manager:start:95 - 同步完成,总耗时 0.01 秒,等待 20 秒
2025-12-04 15:32:31 | INFO | sync.manager:signal_handler:382 - 接收到信号 2正在关闭...
2025-12-04 15:32:43 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 16:20:34 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 16:20:34 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 16:20:34 | INFO | sync.manager:_get_computer_names:143 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 16:20:34 | INFO | sync.manager:__init__:39 - 启用持仓批量同步
2025-12-04 16:20:34 | INFO | sync.manager:__init__:44 - 启用订单批量同步
2025-12-04 16:20:34 | INFO | sync.manager:__init__:49 - 启用账户信息批量同步
2025-12-04 16:20:34 | INFO | sync.manager:start:67 - 同步服务启动,间隔 20 秒
2025-12-04 16:20:34 | INFO | utils.redis_client:_init_connection_pool:48 - Redis连接池初始化成功
2025-12-04 16:20:34 | INFO | sync.manager:_get_accounts_by_computer_name:161 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 16:20:34 | INFO | sync.manager:_get_accounts_by_computer_name:186 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 16:20:34 | INFO | sync.manager:get_accounts_from_redis:131 - 从 2 个计算机名获取到 22 个账号
2025-12-04 16:20:34 | INFO | sync.manager:start:84 - 第1次同步开始共 22 个账号
2025-12-04 16:20:34 | INFO | sync.position_sync:sync_batch:18 - 开始批量同步持仓数据,共 22 个账号
2025-12-04 16:20:34 | ERROR | sync.position_sync:sync_batch:42 - 持仓批量同步失败: 'PositionSyncBatch' object has no attribute '_collect_all_positions'
2025-12-04 16:20:34 | ERROR | sync.position_sync:sync_batch:49 - 完整堆栈跟踪:
Traceback (most recent call last):
File "/root/project/exchange_monitor_sync/sync/position_sync.py", line 23, in sync_batch
all_positions = await self._collect_all_positions(accounts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PositionSyncBatch' object has no attribute '_collect_all_positions'
2025-12-04 16:20:34 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 16:20:34 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 16:20:34 | ERROR | sync.account_sync:_collect_all_account_data:59 - 收集账户信息数据失败: name 'asyncio' is not defined
2025-12-04 16:20:34 | INFO | sync.account_sync:sync_batch:21 - 无账户信息数据需要同步
2025-12-04 16:20:34 | INFO | sync.manager:_update_stats:378 - === 第1次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 16:20:34 | INFO | sync.manager:start:95 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 16:20:53 | INFO | sync.manager:signal_handler:382 - 接收到信号 2正在关闭...
2025-12-04 16:20:54 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 16:40:35 | ERROR | __main__:<module>:49 - 程序异常: name 'Optional' is not defined
2025-12-04 16:40:35 | ERROR | __main__:<module>:51 - Traceback (most recent call last):
File "/root/project/exchange_monitor_sync/main.py", line 45, in <module>
asyncio.run(main())
File "/root/.pyenv/versions/3.11.10/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/3.11.10/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/3.11.10/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/root/project/exchange_monitor_sync/main.py", line 25, in main
from sync.manager import SyncManager
File "/root/project/exchange_monitor_sync/sync/manager.py", line 10, in <module>
from utils.redis_client import RedisClient
File "/root/project/exchange_monitor_sync/utils/redis_client.py", line 10, in <module>
class RedisClient:
File "/root/project/exchange_monitor_sync/utils/redis_client.py", line 215, in RedisClient
def parse_account(self, exchange_id: str, account_id: str, account_info: str) -> Optional[Dict]:
^^^^^^^^
NameError: name 'Optional' is not defined
2025-12-04 16:41:14 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 16:41:14 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 16:41:14 | INFO | utils.redis_client:_get_computer_names:87 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 16:41:15 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 16:41:15 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 16:41:15 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 16:41:15 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 16:41:15 | ERROR | utils.redis_client:_get_accounts_by_computer_name:133 - 获取计算机名 lz_c01 的账号失败: 'RedisClient' object has no attribute 'redis_client'
2025-12-04 16:41:15 | ERROR | utils.redis_client:_get_accounts_by_computer_name:133 - 获取计算机名 lz_c02 的账号失败: 'RedisClient' object has no attribute 'redis_client'
2025-12-04 16:41:15 | WARNING | utils.redis_client:get_accounts_from_redis:71 - 配置的计算机名未找到数据,尝试自动发现...
2025-12-04 16:41:15 | ERROR | utils.redis_client:_discover_all_accounts:174 - 自动发现账号失败: 'RedisClient' object has no attribute 'redis_client'
2025-12-04 16:41:15 | INFO | utils.redis_client:get_accounts_from_redis:74 - 从 2 个计算机名获取到 0 个账号
2025-12-04 16:41:15 | WARNING | sync.manager:start:73 - 未获取到任何账号,等待下次同步
2025-12-04 16:41:17 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 16:41:35 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 16:43:07 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 16:43:07 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 16:43:07 | INFO | utils.redis_client:_get_computer_names:87 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 16:43:07 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 16:43:07 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 16:43:07 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 16:43:07 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 16:43:07 | INFO | utils.redis_client:_init_connection_pool:51 - Redis连接池初始化成功
2025-12-04 16:43:07 | INFO | utils.redis_client:_get_accounts_by_computer_name:105 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 16:43:07 | INFO | utils.redis_client:_get_accounts_by_computer_name:130 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 16:43:07 | INFO | utils.redis_client:get_accounts_from_redis:74 - 从 2 个计算机名获取到 22 个账号
2025-12-04 16:43:07 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 16:43:07 | INFO | sync.position_sync:sync_batch:20 - 开始批量同步持仓数据,共 22 个账号
2025-12-04 16:43:07 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 16:43:07 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 16:43:07 | ERROR | sync.account_sync:_collect_all_account_data:59 - 收集账户信息数据失败: name 'asyncio' is not defined
2025-12-04 16:43:07 | INFO | sync.account_sync:sync_batch:21 - 无账户信息数据需要同步
2025-12-04 16:43:07 | INFO | sync.position_sync:sync_batch:32 - 收集到 92 条持仓数据
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 999999, 'st_id': 5549, 'side': 'sell', 'qty': 0.936, 'symbol': 'BTCUSDT', 'price': 93533.49297627, 'leverage': 20.0, 'uptime': 1764828465, 'liquidation_price': 264730.8837374, 'profit_price': None, 'stop_price': None, 'asset_profit': 571.1406258, 'asset': 'USDT', 'asset_num': 87547.3494258, 'exchange_id': 'bybit'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 999999, 'st_id': 5549, 'side': 'buy', 'qty': 1.87, 'symbol': 'BTC-4DEC25-93000-C-USDT', 'price': 965.0, 'leverage': None, 'uptime': 1764828465, 'liquidation_price': None, 'profit_price': None, 'stop_price': None, 'asset_profit': -1414.87970189, 'asset': 'USDT', 'asset_num': 389.6702981, 'exchange_id': 'bybit'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4219.78, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4430.769, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 35.29, 'asset': 'USDT', 'asset_num': 4219.78, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.65, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4451.6325, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.16, 'asset': 'USDT', 'asset_num': 4239.65, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4239.65, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4451.6325, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.16, 'asset': 'USDT', 'asset_num': 4239.65, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4239.78, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4451.769, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.29, 'asset': 'USDT', 'asset_num': 4239.78, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_4', 'price': 4239.76, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4451.7480000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.27, 'asset': 'USDT', 'asset_num': 4239.76, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_5', 'price': 4238.89, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4450.834500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.4, 'asset': 'USDT', 'asset_num': 4238.89, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_6', 'price': 4237.57, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4449.4484999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.08, 'asset': 'USDT', 'asset_num': 4237.57, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_7', 'price': 4237.55, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4449.427500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.06, 'asset': 'USDT', 'asset_num': 4237.55, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_8', 'price': 4237.6, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4449.4800000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.11, 'asset': 'USDT', 'asset_num': 4237.6, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_9', 'price': 4229.85, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4441.342500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.36, 'asset': 'USDT', 'asset_num': 4229.85, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_10', 'price': 4233.12, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.776, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.63, 'asset': 'USDT', 'asset_num': 4233.12, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_11', 'price': 4233.46, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4445.133, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.97, 'asset': 'USDT', 'asset_num': 4233.46, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_12', 'price': 4232.42, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.041, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.93, 'asset': 'USDT', 'asset_num': 4232.42, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_13', 'price': 4232.72, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.356000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.23, 'asset': 'USDT', 'asset_num': 4232.72, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_14', 'price': 4232.93, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.5765, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.44, 'asset': 'USDT', 'asset_num': 4232.93, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_15', 'price': 4232.91, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.5555, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.42, 'asset': 'USDT', 'asset_num': 4232.91, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_16', 'price': 4232.86, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.503, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.37, 'asset': 'USDT', 'asset_num': 4232.86, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_17', 'price': 4232.24, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4443.852, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.75, 'asset': 'USDT', 'asset_num': 4232.24, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_18', 'price': 4231.4, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4442.97, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 46.91, 'asset': 'USDT', 'asset_num': 4231.4, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4220.02, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4431.021000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 35.57, 'asset': 'USDT', 'asset_num': 4220.02, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.06, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.013000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.61, 'asset': 'USDT', 'asset_num': 4239.06, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4239.6, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.580000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.15, 'asset': 'USDT', 'asset_num': 4239.6, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4239.8, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.79, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.35, 'asset': 'USDT', 'asset_num': 4239.8, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_4', 'price': 4239.76, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.7480000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.31, 'asset': 'USDT', 'asset_num': 4239.76, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_5', 'price': 4239.2, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.16, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.75, 'asset': 'USDT', 'asset_num': 4239.2, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_6', 'price': 4237.57, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4449.4484999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.12, 'asset': 'USDT', 'asset_num': 4237.57, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_7', 'price': 4237.57, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4449.4484999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.12, 'asset': 'USDT', 'asset_num': 4237.57, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_8', 'price': 4237.56, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4449.438000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.11, 'asset': 'USDT', 'asset_num': 4237.56, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_9', 'price': 4238.31, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4450.2255000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.86, 'asset': 'USDT', 'asset_num': 4238.31, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_10', 'price': 4229.55, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4441.0275, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.1, 'asset': 'USDT', 'asset_num': 4229.55, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_11', 'price': 4232.78, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.419, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.33, 'asset': 'USDT', 'asset_num': 4232.78, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_12', 'price': 4233.1, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.755000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.65, 'asset': 'USDT', 'asset_num': 4233.1, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_13', 'price': 4233.12, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.776, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.67, 'asset': 'USDT', 'asset_num': 4233.12, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_14', 'price': 4232.42, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.041, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.97, 'asset': 'USDT', 'asset_num': 4232.42, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_15', 'price': 4232.29, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4443.904500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.84, 'asset': 'USDT', 'asset_num': 4232.29, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_16', 'price': 4232.27, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4443.883500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.82, 'asset': 'USDT', 'asset_num': 4232.27, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_17', 'price': 4232.72, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.356000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.27, 'asset': 'USDT', 'asset_num': 4232.72, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10123, 'st_id': 5539, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4230.55, 'leverage': 100, 'uptime': 1764828448, 'liquidation_price': 4442.0775, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 46.5, 'asset': 'USDT', 'asset_num': 4230.55, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10123, 'st_id': 5539, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.04, 'leverage': 100, 'uptime': 1764828448, 'liquidation_price': 4450.992, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.99, 'asset': 'USDT', 'asset_num': 4239.04, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10123, 'st_id': 5539, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4239.64, 'leverage': 100, 'uptime': 1764828448, 'liquidation_price': 4451.622, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.59, 'asset': 'USDT', 'asset_num': 4239.64, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10123, 'st_id': 5539, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4229.75, 'leverage': 100, 'uptime': 1764828448, 'liquidation_price': 4441.2375, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.7, 'asset': 'USDT', 'asset_num': 4229.75, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10125, 'st_id': 5540, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4220.02, 'leverage': 100, 'uptime': 1764828451, 'liquidation_price': 4431.021000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 35.98, 'asset': 'USDT', 'asset_num': 4220.02, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10125, 'st_id': 5540, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.66, 'leverage': 100, 'uptime': 1764828451, 'liquidation_price': 4451.643, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.62, 'asset': 'USDT', 'asset_num': 4239.66, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10125, 'st_id': 5540, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4239.8, 'leverage': 100, 'uptime': 1764828451, 'liquidation_price': 4451.79, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.76, 'asset': 'USDT', 'asset_num': 4239.8, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10125, 'st_id': 5540, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4229.55, 'leverage': 100, 'uptime': 1764828451, 'liquidation_price': 4441.0275, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.51, 'asset': 'USDT', 'asset_num': 4229.55, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4252.18, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.789000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.81, 'asset': 'USDT', 'asset_num': 4252.18, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4251.59, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.1695, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.22, 'asset': 'USDT', 'asset_num': 4251.59, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4252.64, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4465.272000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.27, 'asset': 'USDT', 'asset_num': 4252.64, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4252.46, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4465.0830000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.09, 'asset': 'USDT', 'asset_num': 4252.46, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_4', 'price': 4252.4, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4465.0199999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.03, 'asset': 'USDT', 'asset_num': 4252.4, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_5', 'price': 4251.83, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.4215, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.46, 'asset': 'USDT', 'asset_num': 4251.83, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_6', 'price': 4252.31, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.9255, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.94, 'asset': 'USDT', 'asset_num': 4252.31, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_7', 'price': 4251.99, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.5895, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.62, 'asset': 'USDT', 'asset_num': 4251.99, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_8', 'price': 4252.46, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4465.0830000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.09, 'asset': 'USDT', 'asset_num': 4252.46, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_9', 'price': 4235.22, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4446.981000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 50.85, 'asset': 'USDT', 'asset_num': 4235.22, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_10', 'price': 4229.4, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4440.87, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.03, 'asset': 'USDT', 'asset_num': 4229.4, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_11', 'price': 4232.32, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4443.936, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.95, 'asset': 'USDT', 'asset_num': 4232.32, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_12', 'price': 4231.73, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4443.3165, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.36, 'asset': 'USDT', 'asset_num': 4231.73, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_13', 'price': 4232.38, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4443.999000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.01, 'asset': 'USDT', 'asset_num': 4232.38, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_14', 'price': 4232.95, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4444.5975, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.58, 'asset': 'USDT', 'asset_num': 4232.95, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4252.98, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.629, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 69.1, 'asset': 'USDT', 'asset_num': 4252.98, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4251.6, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4464.18, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.72, 'asset': 'USDT', 'asset_num': 4251.6, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4252.58, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.209, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.7, 'asset': 'USDT', 'asset_num': 4252.58, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4252.44, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.062, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.56, 'asset': 'USDT', 'asset_num': 4252.44, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_4', 'price': 4251.83, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4464.4215, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.95, 'asset': 'USDT', 'asset_num': 4251.83, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_5', 'price': 4251.99, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4464.5895, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.11, 'asset': 'USDT', 'asset_num': 4251.99, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_6', 'price': 4252.99, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.6395, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 69.11, 'asset': 'USDT', 'asset_num': 4252.99, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_7', 'price': 4252.46, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.0830000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.58, 'asset': 'USDT', 'asset_num': 4252.46, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_8', 'price': 4253.18, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.839000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 69.3, 'asset': 'USDT', 'asset_num': 4253.18, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_9', 'price': 4241.25, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4453.3125, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 57.37, 'asset': 'USDT', 'asset_num': 4241.25, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_10', 'price': 4241.24, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4453.302, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 57.36, 'asset': 'USDT', 'asset_num': 4241.24, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_11', 'price': 4238.61, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4450.5405, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.73, 'asset': 'USDT', 'asset_num': 4238.61, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_12', 'price': 4229.75, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4441.2375, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.87, 'asset': 'USDT', 'asset_num': 4229.75, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_13', 'price': 4232.45, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4444.0725, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.57, 'asset': 'USDT', 'asset_num': 4232.45, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_14', 'price': 4232.3, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.915, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.42, 'asset': 'USDT', 'asset_num': 4232.3, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_15', 'price': 4232.25, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.8625, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.37, 'asset': 'USDT', 'asset_num': 4232.25, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_16', 'price': 4232.38, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.999000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.5, 'asset': 'USDT', 'asset_num': 4232.38, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_17', 'price': 4232.38, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.999000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.5, 'asset': 'USDT', 'asset_num': 4232.38, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_18', 'price': 4232.72, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4444.356000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.84, 'asset': 'USDT', 'asset_num': 4232.72, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_19', 'price': 4232.93, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4444.5765, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 49.05, 'asset': 'USDT', 'asset_num': 4232.93, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_20', 'price': 4231.73, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.3165, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.85, 'asset': 'USDT', 'asset_num': 4231.73, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_21', 'price': 4227.03, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4438.3814999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 43.15, 'asset': 'USDT', 'asset_num': 4227.03, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_22', 'price': 4196.72, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4406.5560000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 12.84, 'asset': 'USDT', 'asset_num': 4196.72, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10140, 'st_id': 5548, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4219.79, 'leverage': 100, 'uptime': 1764828463, 'liquidation_price': 4430.779500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 36.3, 'asset': 'USDT', 'asset_num': 4219.79, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10140, 'st_id': 5548, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.06, 'leverage': 100, 'uptime': 1764828463, 'liquidation_price': 4451.013000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.57, 'asset': 'USDT', 'asset_num': 4239.06, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10142, 'st_id': 5549, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4219.79, 'leverage': 100, 'uptime': 1764828465, 'liquidation_price': 4430.779500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 36.47, 'asset': 'USDT', 'asset_num': 4219.79, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10144, 'st_id': 5550, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4230.53, 'leverage': 100, 'uptime': 1764828405, 'liquidation_price': 4442.0565, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.35, 'asset': 'USDT', 'asset_num': 4230.53, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 10144, 'st_id': 5550, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4238.96, 'leverage': 100, 'uptime': 1764828405, 'liquidation_price': 4450.908, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.78, 'asset': 'USDT', 'asset_num': 4238.96, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 88887, 'st_id': 88882, 'side': 'sell', 'qty': 0.08, 'symbol': 'XAUAUD+_0', 'price': 6326.33, 'leverage': 100, 'uptime': 1764828408, 'liquidation_price': 6642.6465, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 0.0, 'asset': 'USDT', 'asset_num': 50610.64, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:333 - 处理持仓数据失败: {'k_id': 88887, 'st_id': 88882, 'side': 'sell', 'qty': 0.08, 'symbol': 'XAUAUD+_1', 'price': 6325.7, 'leverage': 100, 'uptime': 1764828408, 'liquidation_price': 6641.985, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 0.0, 'asset': 'USDT', 'asset_num': 50605.6, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:43:07 | INFO | sync.position_sync:sync_batch:39 - 持仓批量同步完成: 处理 0 条,受影响 0 条,删除 0 条,耗时 0.02秒
2025-12-04 16:43:07 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.02秒 | 平均耗时: 0.00秒
2025-12-04 16:43:07 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.02 秒,等待 20 秒
2025-12-04 16:43:10 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 16:43:27 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 16:53:12 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 16:53:12 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 16:53:12 | INFO | utils.redis_client:_get_computer_names:87 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 16:53:12 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 16:53:12 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 16:53:12 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 16:53:12 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 16:53:12 | INFO | utils.redis_client:_init_connection_pool:51 - Redis连接池初始化成功
2025-12-04 16:53:12 | INFO | utils.redis_client:_get_accounts_by_computer_name:105 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 16:53:12 | INFO | utils.redis_client:_get_accounts_by_computer_name:130 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 16:53:12 | INFO | utils.redis_client:get_accounts_from_redis:74 - 从 2 个计算机名获取到 22 个账号
2025-12-04 16:53:12 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 16:53:12 | INFO | sync.position_sync:sync_batch:18 - 开始批量同步持仓数据,共 22 个账号
2025-12-04 16:53:12 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 16:53:12 | INFO | sync.position_sync:sync_batch:30 - 收集到 92 条持仓数据
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 999999, 'st_id': 5549, 'side': 'sell', 'qty': 0.936, 'symbol': 'BTCUSDT', 'price': 93533.49297627, 'leverage': 20.0, 'uptime': 1764828465, 'liquidation_price': 264730.8837374, 'profit_price': None, 'stop_price': None, 'asset_profit': 571.1406258, 'asset': 'USDT', 'asset_num': 87547.3494258, 'exchange_id': 'bybit'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 999999, 'st_id': 5549, 'side': 'buy', 'qty': 1.87, 'symbol': 'BTC-4DEC25-93000-C-USDT', 'price': 965.0, 'leverage': None, 'uptime': 1764828465, 'liquidation_price': None, 'profit_price': None, 'stop_price': None, 'asset_profit': -1414.87970189, 'asset': 'USDT', 'asset_num': 389.6702981, 'exchange_id': 'bybit'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4219.78, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4430.769, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 35.29, 'asset': 'USDT', 'asset_num': 4219.78, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.65, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4451.6325, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.16, 'asset': 'USDT', 'asset_num': 4239.65, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4239.65, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4451.6325, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.16, 'asset': 'USDT', 'asset_num': 4239.65, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4239.78, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4451.769, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.29, 'asset': 'USDT', 'asset_num': 4239.78, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_4', 'price': 4239.76, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4451.7480000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.27, 'asset': 'USDT', 'asset_num': 4239.76, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_5', 'price': 4238.89, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4450.834500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.4, 'asset': 'USDT', 'asset_num': 4238.89, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_6', 'price': 4237.57, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4449.4484999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.08, 'asset': 'USDT', 'asset_num': 4237.57, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_7', 'price': 4237.55, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4449.427500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.06, 'asset': 'USDT', 'asset_num': 4237.55, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_8', 'price': 4237.6, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4449.4800000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.11, 'asset': 'USDT', 'asset_num': 4237.6, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_9', 'price': 4229.85, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4441.342500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.36, 'asset': 'USDT', 'asset_num': 4229.85, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_10', 'price': 4233.12, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.776, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.63, 'asset': 'USDT', 'asset_num': 4233.12, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_11', 'price': 4233.46, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4445.133, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.97, 'asset': 'USDT', 'asset_num': 4233.46, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_12', 'price': 4232.42, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.041, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.93, 'asset': 'USDT', 'asset_num': 4232.42, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_13', 'price': 4232.72, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.356000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.23, 'asset': 'USDT', 'asset_num': 4232.72, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_14', 'price': 4232.93, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.5765, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.44, 'asset': 'USDT', 'asset_num': 4232.93, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_15', 'price': 4232.91, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.5555, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.42, 'asset': 'USDT', 'asset_num': 4232.91, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_16', 'price': 4232.86, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4444.503, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.37, 'asset': 'USDT', 'asset_num': 4232.86, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_17', 'price': 4232.24, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4443.852, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.75, 'asset': 'USDT', 'asset_num': 4232.24, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10107, 'st_id': 5531, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_18', 'price': 4231.4, 'leverage': 100, 'uptime': 1764828442, 'liquidation_price': 4442.97, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 46.91, 'asset': 'USDT', 'asset_num': 4231.4, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4220.02, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4431.021000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 35.57, 'asset': 'USDT', 'asset_num': 4220.02, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.06, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.013000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.61, 'asset': 'USDT', 'asset_num': 4239.06, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4239.6, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.580000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.15, 'asset': 'USDT', 'asset_num': 4239.6, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4239.8, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.79, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.35, 'asset': 'USDT', 'asset_num': 4239.8, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_4', 'price': 4239.76, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.7480000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.31, 'asset': 'USDT', 'asset_num': 4239.76, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_5', 'price': 4239.2, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4451.16, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.75, 'asset': 'USDT', 'asset_num': 4239.2, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_6', 'price': 4237.57, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4449.4484999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.12, 'asset': 'USDT', 'asset_num': 4237.57, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_7', 'price': 4237.57, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4449.4484999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.12, 'asset': 'USDT', 'asset_num': 4237.57, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_8', 'price': 4237.56, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4449.438000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.11, 'asset': 'USDT', 'asset_num': 4237.56, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_9', 'price': 4238.31, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4450.2255000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.86, 'asset': 'USDT', 'asset_num': 4238.31, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_10', 'price': 4229.55, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4441.0275, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.1, 'asset': 'USDT', 'asset_num': 4229.55, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_11', 'price': 4232.78, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.419, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.33, 'asset': 'USDT', 'asset_num': 4232.78, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_12', 'price': 4233.1, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.755000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.65, 'asset': 'USDT', 'asset_num': 4233.1, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_13', 'price': 4233.12, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.776, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.67, 'asset': 'USDT', 'asset_num': 4233.12, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_14', 'price': 4232.42, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.041, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.97, 'asset': 'USDT', 'asset_num': 4232.42, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_15', 'price': 4232.29, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4443.904500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.84, 'asset': 'USDT', 'asset_num': 4232.29, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_16', 'price': 4232.27, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4443.883500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.82, 'asset': 'USDT', 'asset_num': 4232.27, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10115, 'st_id': 5535, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_17', 'price': 4232.72, 'leverage': 100, 'uptime': 1764828445, 'liquidation_price': 4444.356000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.27, 'asset': 'USDT', 'asset_num': 4232.72, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10123, 'st_id': 5539, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4230.55, 'leverage': 100, 'uptime': 1764828448, 'liquidation_price': 4442.0775, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 46.5, 'asset': 'USDT', 'asset_num': 4230.55, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10123, 'st_id': 5539, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.04, 'leverage': 100, 'uptime': 1764828448, 'liquidation_price': 4450.992, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.99, 'asset': 'USDT', 'asset_num': 4239.04, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10123, 'st_id': 5539, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4239.64, 'leverage': 100, 'uptime': 1764828448, 'liquidation_price': 4451.622, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.59, 'asset': 'USDT', 'asset_num': 4239.64, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10123, 'st_id': 5539, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4229.75, 'leverage': 100, 'uptime': 1764828448, 'liquidation_price': 4441.2375, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.7, 'asset': 'USDT', 'asset_num': 4229.75, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10125, 'st_id': 5540, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4220.02, 'leverage': 100, 'uptime': 1764828451, 'liquidation_price': 4431.021000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 35.98, 'asset': 'USDT', 'asset_num': 4220.02, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10125, 'st_id': 5540, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.66, 'leverage': 100, 'uptime': 1764828451, 'liquidation_price': 4451.643, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.62, 'asset': 'USDT', 'asset_num': 4239.66, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10125, 'st_id': 5540, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4239.8, 'leverage': 100, 'uptime': 1764828451, 'liquidation_price': 4451.79, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.76, 'asset': 'USDT', 'asset_num': 4239.8, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10125, 'st_id': 5540, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4229.55, 'leverage': 100, 'uptime': 1764828451, 'liquidation_price': 4441.0275, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.51, 'asset': 'USDT', 'asset_num': 4229.55, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4252.18, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.789000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.81, 'asset': 'USDT', 'asset_num': 4252.18, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4251.59, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.1695, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.22, 'asset': 'USDT', 'asset_num': 4251.59, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4252.64, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4465.272000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.27, 'asset': 'USDT', 'asset_num': 4252.64, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4252.46, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4465.0830000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.09, 'asset': 'USDT', 'asset_num': 4252.46, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_4', 'price': 4252.4, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4465.0199999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.03, 'asset': 'USDT', 'asset_num': 4252.4, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_5', 'price': 4251.83, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.4215, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.46, 'asset': 'USDT', 'asset_num': 4251.83, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_6', 'price': 4252.31, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.9255, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.94, 'asset': 'USDT', 'asset_num': 4252.31, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_7', 'price': 4251.99, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4464.5895, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.62, 'asset': 'USDT', 'asset_num': 4251.99, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_8', 'price': 4252.46, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4465.0830000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.09, 'asset': 'USDT', 'asset_num': 4252.46, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_9', 'price': 4235.22, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4446.981000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 50.85, 'asset': 'USDT', 'asset_num': 4235.22, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_10', 'price': 4229.4, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4440.87, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.03, 'asset': 'USDT', 'asset_num': 4229.4, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_11', 'price': 4232.32, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4443.936, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.95, 'asset': 'USDT', 'asset_num': 4232.32, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_12', 'price': 4231.73, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4443.3165, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.36, 'asset': 'USDT', 'asset_num': 4231.73, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_13', 'price': 4232.38, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4443.999000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.01, 'asset': 'USDT', 'asset_num': 4232.38, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10131, 'st_id': 5543, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_14', 'price': 4232.95, 'leverage': 100, 'uptime': 1764828457, 'liquidation_price': 4444.5975, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.58, 'asset': 'USDT', 'asset_num': 4232.95, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4252.98, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.629, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 69.1, 'asset': 'USDT', 'asset_num': 4252.98, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4251.6, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4464.18, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.72, 'asset': 'USDT', 'asset_num': 4251.6, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_2', 'price': 4252.58, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.209, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.7, 'asset': 'USDT', 'asset_num': 4252.58, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_3', 'price': 4252.44, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.062, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.56, 'asset': 'USDT', 'asset_num': 4252.44, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_4', 'price': 4251.83, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4464.4215, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 67.95, 'asset': 'USDT', 'asset_num': 4251.83, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_5', 'price': 4251.99, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4464.5895, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.11, 'asset': 'USDT', 'asset_num': 4251.99, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_6', 'price': 4252.99, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.6395, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 69.11, 'asset': 'USDT', 'asset_num': 4252.99, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_7', 'price': 4252.46, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.0830000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 68.58, 'asset': 'USDT', 'asset_num': 4252.46, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_8', 'price': 4253.18, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4465.839000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 69.3, 'asset': 'USDT', 'asset_num': 4253.18, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_9', 'price': 4241.25, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4453.3125, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 57.37, 'asset': 'USDT', 'asset_num': 4241.25, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_10', 'price': 4241.24, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4453.302, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 57.36, 'asset': 'USDT', 'asset_num': 4241.24, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_11', 'price': 4238.61, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4450.5405, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 54.73, 'asset': 'USDT', 'asset_num': 4238.61, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_12', 'price': 4229.75, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4441.2375, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.87, 'asset': 'USDT', 'asset_num': 4229.75, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_13', 'price': 4232.45, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4444.0725, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.57, 'asset': 'USDT', 'asset_num': 4232.45, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_14', 'price': 4232.3, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.915, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.42, 'asset': 'USDT', 'asset_num': 4232.3, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_15', 'price': 4232.25, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.8625, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.37, 'asset': 'USDT', 'asset_num': 4232.25, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_16', 'price': 4232.38, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.999000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.5, 'asset': 'USDT', 'asset_num': 4232.38, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_17', 'price': 4232.38, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.999000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.5, 'asset': 'USDT', 'asset_num': 4232.38, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_18', 'price': 4232.72, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4444.356000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 48.84, 'asset': 'USDT', 'asset_num': 4232.72, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_19', 'price': 4232.93, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4444.5765, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 49.05, 'asset': 'USDT', 'asset_num': 4232.93, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_20', 'price': 4231.73, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4443.3165, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 47.85, 'asset': 'USDT', 'asset_num': 4231.73, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_21', 'price': 4227.03, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4438.3814999999995, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 43.15, 'asset': 'USDT', 'asset_num': 4227.03, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10138, 'st_id': 5547, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_22', 'price': 4196.72, 'leverage': 100, 'uptime': 1764828460, 'liquidation_price': 4406.5560000000005, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 12.84, 'asset': 'USDT', 'asset_num': 4196.72, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10140, 'st_id': 5548, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4219.79, 'leverage': 100, 'uptime': 1764828463, 'liquidation_price': 4430.779500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 36.3, 'asset': 'USDT', 'asset_num': 4219.79, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10140, 'st_id': 5548, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4239.06, 'leverage': 100, 'uptime': 1764828463, 'liquidation_price': 4451.013000000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 55.57, 'asset': 'USDT', 'asset_num': 4239.06, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10142, 'st_id': 5549, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4219.79, 'leverage': 100, 'uptime': 1764828465, 'liquidation_price': 4430.779500000001, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 36.47, 'asset': 'USDT', 'asset_num': 4219.79, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10144, 'st_id': 5550, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_0', 'price': 4230.53, 'leverage': 100, 'uptime': 1764828405, 'liquidation_price': 4442.0565, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 45.35, 'asset': 'USDT', 'asset_num': 4230.53, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 10144, 'st_id': 5550, 'side': 'sell', 'qty': 0.01, 'symbol': 'XAUUSD+_1', 'price': 4238.96, 'leverage': 100, 'uptime': 1764828405, 'liquidation_price': 4450.908, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 53.78, 'asset': 'USDT', 'asset_num': 4238.96, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 88887, 'st_id': 88882, 'side': 'sell', 'qty': 0.08, 'symbol': 'XAUAUD+_0', 'price': 6326.33, 'leverage': 100, 'uptime': 1764828408, 'liquidation_price': 6642.6465, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 0.0, 'asset': 'USDT', 'asset_num': 50610.64, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | ERROR | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:331 - 处理持仓数据失败: {'k_id': 88887, 'st_id': 88882, 'side': 'sell', 'qty': 0.08, 'symbol': 'XAUAUD+_1', 'price': 6325.7, 'leverage': 100, 'uptime': 1764828408, 'liquidation_price': 6641.985, 'profit_price': 0.0, 'stop_price': 0.0, 'asset_profit': 0.0, 'asset': 'USDT', 'asset_num': 50605.6, 'exchange_id': 'mt5'}, error='PositionSyncBatch' object has no attribute '_convert_position_data'
2025-12-04 16:53:12 | INFO | sync.position_sync:sync_batch:37 - 持仓批量同步完成: 处理 0 条,受影响 0 条,删除 0 条,耗时 0.01秒
2025-12-04 16:53:12 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.01秒 | 平均耗时: 0.00秒
2025-12-04 16:53:12 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.01 秒,等待 20 秒
2025-12-04 16:53:14 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 16:53:32 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 16:55:45 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 16:55:45 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 16:55:45 | INFO | utils.redis_client:_get_computer_names:87 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 16:55:45 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 16:55:45 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 16:55:45 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 16:55:45 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 16:55:45 | INFO | utils.redis_client:_init_connection_pool:51 - Redis连接池初始化成功
2025-12-04 16:55:45 | INFO | utils.redis_client:_get_accounts_by_computer_name:105 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 16:55:45 | INFO | utils.redis_client:_get_accounts_by_computer_name:130 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 16:55:45 | INFO | utils.redis_client:get_accounts_from_redis:74 - 从 2 个计算机名获取到 22 个账号
2025-12-04 16:55:45 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 16:55:45 | INFO | sync.position_sync:sync_batch:19 - 开始批量同步持仓数据,共 22 个账号
2025-12-04 16:55:45 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 16:55:45 | INFO | sync.position_sync:sync_batch:31 - 收集到 92 条持仓数据
2025-12-04 16:55:45 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:340 - 准备同步 92 条持仓数据,去重后 92 条唯一记录
2025-12-04 16:55:45 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:370 - UPSERT完成: 总数 92 条, 受影响 92 条
2025-12-04 16:55:45 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:403 - 删除 0 条过期持仓
2025-12-04 16:55:45 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:407 - 批量同步V3完成: 总数=92, 受影响=92, 删除=0
2025-12-04 16:55:45 | INFO | sync.position_sync:sync_batch:38 - 持仓批量同步完成: 处理 92 条,受影响 92 条,删除 0 条,耗时 0.01秒
2025-12-04 16:55:45 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.01秒 | 平均耗时: 0.00秒
2025-12-04 16:55:45 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.01 秒,等待 20 秒
2025-12-04 16:55:49 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 16:56:05 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 16:57:13 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 16:57:13 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 16:57:13 | INFO | utils.redis_client:_get_computer_names:87 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 16:57:13 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 16:57:13 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 16:57:13 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 16:57:13 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 16:57:13 | INFO | utils.redis_client:_init_connection_pool:51 - Redis连接池初始化成功
2025-12-04 16:57:13 | INFO | utils.redis_client:_get_accounts_by_computer_name:105 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 16:57:13 | INFO | utils.redis_client:_get_accounts_by_computer_name:130 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 16:57:13 | INFO | utils.redis_client:get_accounts_from_redis:74 - 从 2 个计算机名获取到 22 个账号
2025-12-04 16:57:13 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 16:57:13 | INFO | sync.position_sync:sync_batch:19 - 开始批量同步持仓数据,共 22 个账号
2025-12-04 16:57:13 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 16:57:13 | INFO | sync.position_sync:sync_batch:31 - 收集到 92 条持仓数据
2025-12-04 16:57:13 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:340 - 准备同步 92 条持仓数据,去重后 92 条唯一记录
2025-12-04 16:57:13 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:370 - UPSERT完成: 总数 92 条, 受影响 92 条
2025-12-04 16:57:13 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:403 - 删除 0 条过期持仓
2025-12-04 16:57:13 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:407 - 批量同步V3完成: 总数=92, 受影响=92, 删除=0
2025-12-04 16:57:13 | INFO | sync.position_sync:sync_batch:38 - 持仓批量同步完成: 处理 92 条,受影响 92 条,删除 0 条,耗时 0.01秒
2025-12-04 16:57:13 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.02秒 | 平均耗时: 0.00秒
2025-12-04 16:57:13 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.02 秒,等待 20 秒
2025-12-04 16:57:18 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 16:57:33 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 17:04:25 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 17:04:25 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 17:04:25 | INFO | utils.redis_client:_get_computer_names:87 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 17:04:25 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 17:04:25 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 17:04:25 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 17:04:25 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 17:04:25 | INFO | utils.redis_client:_init_connection_pool:51 - Redis连接池初始化成功
2025-12-04 17:04:25 | INFO | utils.redis_client:_get_accounts_by_computer_name:105 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 17:04:25 | INFO | utils.redis_client:_get_accounts_by_computer_name:130 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 17:04:25 | INFO | utils.redis_client:get_accounts_from_redis:74 - 从 2 个计算机名获取到 22 个账号
2025-12-04 17:04:25 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 17:04:25 | INFO | sync.position_sync:sync_batch:19 - 开始批量同步持仓数据,共 22 个账号
2025-12-04 17:04:25 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 17:04:25 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10106, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10113, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10114, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10122, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10124, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10130, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10132, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10137, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10139, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10141, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=999999, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10107, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10115, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10123, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10125, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10129, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10131, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10138, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10140, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10142, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10144, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=88887, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:04:25 | INFO | utils.redis_client:_collect_all_account_data:346 - 收集到 0 条账户信息记录
2025-12-04 17:04:25 | INFO | sync.position_sync:sync_batch:31 - 收集到 92 条持仓数据
2025-12-04 17:04:25 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:340 - 准备同步 92 条持仓数据,去重后 92 条唯一记录
2025-12-04 17:04:25 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:370 - UPSERT完成: 总数 92 条, 受影响 92 条
2025-12-04 17:04:25 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:403 - 删除 0 条过期持仓
2025-12-04 17:04:25 | INFO | sync.position_sync:_sync_positions_batch_to_db_optimized_v3:407 - 批量同步V3完成: 总数=92, 受影响=92, 删除=0
2025-12-04 17:04:25 | INFO | sync.position_sync:sync_batch:38 - 持仓批量同步完成: 处理 92 条,受影响 92 条,删除 0 条,耗时 0.02秒
2025-12-04 17:04:25 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.02秒 | 平均耗时: 0.00秒
2025-12-04 17:04:25 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.02 秒,等待 20 秒
2025-12-04 17:04:30 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 17:04:45 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 17:05:03 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 17:05:03 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 17:05:03 | INFO | utils.redis_client:_get_computer_names:87 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 17:05:03 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 17:05:03 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 17:05:03 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 17:05:03 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 17:05:03 | INFO | utils.redis_client:_init_connection_pool:51 - Redis连接池初始化成功
2025-12-04 17:05:03 | INFO | utils.redis_client:_get_accounts_by_computer_name:105 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 17:05:03 | INFO | utils.redis_client:_get_accounts_by_computer_name:130 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 17:05:03 | INFO | utils.redis_client:get_accounts_from_redis:74 - 从 2 个计算机名获取到 22 个账号
2025-12-04 17:05:03 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 17:05:03 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 17:05:03 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10106, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10113, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10114, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10122, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10124, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10130, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10132, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10137, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10139, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10141, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=999999, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10107, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10115, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10123, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10125, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10129, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10131, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10138, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10140, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10142, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=10144, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | ERROR | utils.redis_client:_get_account_info_from_redis:469 - 获取Redis账户信息失败: k_id=88887, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:05:03 | INFO | utils.redis_client:_collect_all_account_data:346 - 收集到 0 条账户信息记录
2025-12-04 17:05:03 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 17:05:03 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 17:05:05 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 17:05:23 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 17:06:09 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 17:06:09 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 17:06:09 | INFO | utils.redis_client:_get_computer_names:88 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 17:06:09 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 17:06:09 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 17:06:09 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 17:06:09 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 17:06:09 | INFO | utils.redis_client:_init_connection_pool:52 - Redis连接池初始化成功
2025-12-04 17:06:09 | INFO | utils.redis_client:_get_accounts_by_computer_name:106 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 17:06:09 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 17:06:09 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 17:06:09 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 17:06:09 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 17:06:09 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10106, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10113, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10114, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10122, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10124, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10130, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10132, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10137, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10139, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10141, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=999999, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10107, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10115, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10123, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10125, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10129, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10131, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10138, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10140, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10142, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=10144, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | ERROR | utils.redis_client:_get_account_info_from_redis:470 - 获取Redis账户信息失败: k_id=88887, error='RedisClient' object has no attribute 'redis_client'
2025-12-04 17:06:09 | INFO | utils.redis_client:_collect_all_account_data:347 - 收集到 0 条账户信息记录
2025-12-04 17:06:09 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 17:06:09 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 17:06:11 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 17:06:29 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 17:06:48 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 17:06:48 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 17:06:48 | INFO | utils.redis_client:_get_computer_names:88 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 17:06:48 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 17:06:48 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 17:06:48 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 17:06:48 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 17:06:48 | INFO | utils.redis_client:_init_connection_pool:52 - Redis连接池初始化成功
2025-12-04 17:06:48 | INFO | utils.redis_client:_get_accounts_by_computer_name:106 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 17:06:48 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 17:06:48 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 17:06:48 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 17:06:48 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 17:06:48 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 17:06:48 | INFO | utils.redis_client:_collect_all_account_data:347 - 收集到 51 条账户信息记录
2025-12-04 17:06:48 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.02秒 | 平均耗时: 0.00秒
2025-12-04 17:06:48 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.02 秒,等待 20 秒
2025-12-04 17:06:50 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 17:07:08 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 18:24:49 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 18:24:49 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 18:24:49 | INFO | utils.redis_client:_get_computer_names:88 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 18:24:49 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 18:24:49 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 18:24:49 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 18:24:49 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 18:24:49 | INFO | utils.redis_client:_init_connection_pool:52 - Redis连接池初始化成功
2025-12-04 18:24:49 | INFO | utils.redis_client:_get_accounts_by_computer_name:106 - 从 lz_c01_strategy_api 获取到 2 个交易所配置
2025-12-04 18:24:49 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 18:24:49 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 18:24:49 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 18:24:49 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 18:24:49 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 18:24:49 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 18:24:49 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 18:24:51 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 18:25:09 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 18:32:05 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 18:32:05 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 18:32:05 | INFO | utils.redis_client:_get_computer_names:88 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 18:32:05 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 18:32:05 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 18:32:05 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 18:32:05 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 18:32:05 | INFO | utils.redis_client:_init_connection_pool:52 - Redis连接池初始化成功
2025-12-04 18:32:05 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 18:32:05 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 18:32:05 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 18:32:05 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 18:32:05 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 18:32:05 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 18:32:05 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 18:32:14 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 18:32:25 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 19:00:43 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 19:00:43 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 19:00:43 | INFO | utils.redis_client:_get_computer_names:88 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 19:00:43 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 19:00:43 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 19:00:43 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 19:00:43 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 19:00:43 | INFO | utils.redis_client:_init_connection_pool:52 - Redis连接池初始化成功
2025-12-04 19:00:43 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:00:43 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:00:43 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 19:00:43 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:00:43 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:00:43 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 19:00:43 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 19:01:03 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:01:03 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:01:03 | INFO | sync.manager:start:81 - 第2次同步开始共 22 个账号
2025-12-04 19:01:03 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:01:03 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:01:03 | INFO | sync.manager:_update_stats:142 - === 第2次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 19:01:03 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 19:01:23 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:01:23 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:01:23 | INFO | sync.manager:start:81 - 第3次同步开始共 22 个账号
2025-12-04 19:01:23 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:01:23 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:01:23 | INFO | sync.manager:_update_stats:142 - === 第3次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 19:01:23 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 19:01:43 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:01:43 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:01:43 | INFO | sync.manager:start:81 - 第4次同步开始共 22 个账号
2025-12-04 19:01:43 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:01:43 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:01:43 | INFO | sync.manager:_update_stats:142 - === 第4次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 19:01:43 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 19:02:03 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:02:03 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:02:03 | INFO | sync.manager:start:81 - 第5次同步开始共 22 个账号
2025-12-04 19:02:03 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:02:03 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:02:03 | INFO | sync.manager:_update_stats:142 - === 第5次同步统计 ===
总耗时: 0.00秒 | 平均耗时: 0.00秒
2025-12-04 19:02:03 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.00 秒,等待 20 秒
2025-12-04 19:02:20 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 19:02:23 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 19:29:34 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 19:29:34 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 19:29:34 | INFO | utils.redis_client:_get_computer_names:88 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 19:29:34 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 19:29:34 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 19:29:34 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 19:29:34 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 19:29:34 | INFO | utils.redis_client:_init_connection_pool:52 - Redis连接池初始化成功
2025-12-04 19:29:34 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:29:34 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:29:34 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 19:29:34 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:29:34 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:29:34 | INFO | utils.redis_client:_collect_all_account_data:347 - 收集到 86 条账户信息记录
2025-12-04 19:29:34 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.04秒 | 平均耗时: 0.00秒
2025-12-04 19:29:34 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.04 秒,等待 20 秒
2025-12-04 19:29:54 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:29:54 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:29:54 | INFO | sync.manager:start:81 - 第2次同步开始共 22 个账号
2025-12-04 19:29:54 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:29:54 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:29:54 | INFO | utils.redis_client:_collect_all_account_data:347 - 收集到 86 条账户信息记录
2025-12-04 19:29:54 | INFO | sync.manager:_update_stats:142 - === 第2次同步统计 ===
总耗时: 0.04秒 | 平均耗时: 0.01秒
2025-12-04 19:29:54 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.04 秒,等待 20 秒
2025-12-04 19:30:14 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:30:14 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:30:14 | INFO | sync.manager:start:81 - 第3次同步开始共 22 个账号
2025-12-04 19:30:14 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:30:14 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:30:14 | INFO | utils.redis_client:_collect_all_account_data:347 - 收集到 86 条账户信息记录
2025-12-04 19:30:14 | INFO | sync.manager:_update_stats:142 - === 第3次同步统计 ===
总耗时: 0.05秒 | 平均耗时: 0.01秒
2025-12-04 19:30:14 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.05 秒,等待 20 秒
2025-12-04 19:30:34 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:30:34 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:30:34 | INFO | sync.manager:start:81 - 第4次同步开始共 22 个账号
2025-12-04 19:30:34 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:30:34 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:30:34 | INFO | utils.redis_client:_collect_all_account_data:347 - 收集到 86 条账户信息记录
2025-12-04 19:30:34 | INFO | sync.manager:_update_stats:142 - === 第4次同步统计 ===
总耗时: 0.04秒 | 平均耗时: 0.01秒
2025-12-04 19:30:34 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.04 秒,等待 20 秒
2025-12-04 19:30:54 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:30:54 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:30:54 | INFO | sync.manager:start:81 - 第5次同步开始共 22 个账号
2025-12-04 19:30:54 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:30:54 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:30:54 | INFO | utils.redis_client:_collect_all_account_data:347 - 收集到 86 条账户信息记录
2025-12-04 19:30:54 | INFO | sync.manager:_update_stats:142 - === 第5次同步统计 ===
总耗时: 0.04秒 | 平均耗时: 0.02秒
2025-12-04 19:30:54 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.04 秒,等待 20 秒
2025-12-04 19:30:58 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 19:31:14 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===
2025-12-04 19:37:54 | INFO | __main__:main:27 - === 交易所数据同步服务启动 ===
2025-12-04 19:37:54 | INFO | __main__:main:28 - 工作目录: /root/project/exchange_monitor_sync
2025-12-04 19:37:54 | INFO | utils.redis_client:_get_computer_names:88 - 使用配置的计算机名列表: ['lz_c01', 'lz_c02']
2025-12-04 19:37:54 | INFO | sync.manager:__init__:36 - 启用持仓批量同步
2025-12-04 19:37:54 | INFO | sync.manager:__init__:41 - 启用订单批量同步
2025-12-04 19:37:54 | INFO | sync.manager:__init__:46 - 启用账户信息批量同步
2025-12-04 19:37:54 | INFO | sync.manager:start:64 - 同步服务启动,间隔 20 秒
2025-12-04 19:37:54 | INFO | utils.redis_client:_init_connection_pool:52 - Redis连接池初始化成功
2025-12-04 19:37:54 | INFO | utils.redis_client:_get_accounts_by_computer_name:131 - 从 lz_c01_strategy_api 解析到 22 个账号
2025-12-04 19:37:54 | INFO | utils.redis_client:get_accounts_from_redis:75 - 从 2 个计算机名获取到 22 个账号
2025-12-04 19:37:54 | INFO | sync.manager:start:81 - 第1次同步开始共 22 个账号
2025-12-04 19:37:54 | INFO | sync.order_sync:sync_batch:22 - 开始批量同步订单数据,共 22 个账号
2025-12-04 19:37:54 | INFO | sync.account_sync:sync_batch:16 - 开始批量同步账户信息,共 22 个账号
2025-12-04 19:37:54 | INFO | utils.redis_client:_collect_all_account_data:347 - 收集到 86 条账户信息记录
2025-12-04 19:37:54 | INFO | sync.account_sync:_batch_upsert_account_info:100 - 原生SQL批量更新账户信息: 86 条记录
2025-12-04 19:37:54 | INFO | sync.account_sync:sync_batch:34 - 账户信息批量同步完成: 处理 86 条记录
2025-12-04 19:37:54 | INFO | sync.manager:_update_stats:142 - === 第1次同步统计 ===
总耗时: 0.05秒 | 平均耗时: 0.00秒
2025-12-04 19:37:54 | INFO | sync.manager:start:92 - 同步完成,总耗时 0.05 秒,等待 20 秒
2025-12-04 19:38:05 | INFO | sync.manager:signal_handler:146 - 接收到信号 2正在关闭...
2025-12-04 19:38:14 | INFO | __main__:main:41 - === 交易所数据同步服务停止 ===

View File

@@ -14,8 +14,14 @@ class AccountSyncBatch(BaseSync):
"""批量同步所有账号的账户信息"""
try:
logger.info(f"开始批量同步账户信息,共 {len(accounts)} 个账号")
# 测试
# res = await self.redis_client._get_account_info_from_redis(10140, 5548, 'mt5')
# print(res)
# return
# 收集所有账号的数据
all_account_data = await self._collect_all_account_data(accounts)
all_account_data = await self.redis_client._collect_all_account_data(accounts)
if not all_account_data:
logger.info("无账户信息数据需要同步")
@@ -32,186 +38,7 @@ class AccountSyncBatch(BaseSync):
except Exception as e:
logger.error(f"账户信息批量同步失败: {e}")
async def _collect_all_account_data(self, accounts: Dict[str, Dict]) -> List[Dict]:
"""收集所有账号的账户信息数据"""
all_account_data = []
try:
# 按交易所分组账号
account_groups = self._group_accounts_by_exchange(accounts)
# 并发收集每个交易所的数据
tasks = []
for exchange_id, account_list in account_groups.items():
task = self._collect_exchange_account_data(exchange_id, account_list)
tasks.append(task)
# 等待所有任务完成并合并结果
results = await asyncio.gather(*tasks, return_exceptions=True)
for result in results:
if isinstance(result, list):
all_account_data.extend(result)
logger.info(f"收集到 {len(all_account_data)} 条账户信息记录")
except Exception as e:
logger.error(f"收集账户信息数据失败: {e}")
return all_account_data
def _group_accounts_by_exchange(self, accounts: Dict[str, Dict]) -> Dict[str, List[Dict]]:
"""按交易所分组账号"""
groups = {}
for account_id, account_info in accounts.items():
exchange_id = account_info.get('exchange_id')
if exchange_id:
if exchange_id not in groups:
groups[exchange_id] = []
groups[exchange_id].append(account_info)
return groups
async def _collect_exchange_account_data(self, exchange_id: str, account_list: List[Dict]) -> List[Dict]:
"""收集某个交易所的账户信息数据"""
account_data_list = []
try:
for account_info in account_list:
k_id = int(account_info['k_id'])
st_id = account_info.get('st_id', 0)
# 从Redis获取账户信息数据
account_data = await self._get_account_info_from_redis(k_id, st_id, exchange_id)
account_data_list.extend(account_data)
logger.debug(f"交易所 {exchange_id}: 收集到 {len(account_data_list)} 条账户信息")
except Exception as e:
logger.error(f"收集交易所 {exchange_id} 账户信息失败: {e}")
return account_data_list
async def _get_account_info_from_redis(self, k_id: int, st_id: int, exchange_id: str) -> List[Dict]:
"""从Redis获取账户信息数据批量优化版本"""
try:
redis_key = f"{exchange_id}:balance:{k_id}"
redis_funds = self.redis_client.client.hgetall(redis_key)
if not redis_funds:
return []
# 按天统计数据
from config.settings import SYNC_CONFIG
recent_days = SYNC_CONFIG['recent_days']
today = datetime.now()
date_stats = {}
# 收集所有日期的数据
for fund_key, fund_json in redis_funds.items():
try:
fund_data = json.loads(fund_json)
date_str = fund_data.get('lz_time', '')
lz_type = fund_data.get('lz_type', '')
if not date_str or lz_type not in ['lz_balance', 'deposit', 'withdrawal']:
continue
# 只处理最近N天的数据
date_obj = datetime.strptime(date_str, '%Y-%m-%d')
if (today - date_obj).days > recent_days:
continue
if date_str not in date_stats:
date_stats[date_str] = {
'balance': 0.0,
'deposit': 0.0,
'withdrawal': 0.0,
'has_balance': False
}
lz_amount = float(fund_data.get('lz_amount', 0))
if lz_type == 'lz_balance':
date_stats[date_str]['balance'] = lz_amount
date_stats[date_str]['has_balance'] = True
elif lz_type == 'deposit':
date_stats[date_str]['deposit'] += lz_amount
elif lz_type == 'withdrawal':
date_stats[date_str]['withdrawal'] += lz_amount
except (json.JSONDecodeError, ValueError) as e:
logger.debug(f"解析Redis数据失败: {fund_key}, error={e}")
continue
# 转换为账户信息数据
account_data_list = []
sorted_dates = sorted(date_stats.keys())
# 获取前一天余额用于计算利润
prev_balance_map = self._get_previous_balances(redis_funds, sorted_dates)
for date_str in sorted_dates:
stats = date_stats[date_str]
# 如果没有余额数据但有充提数据,仍然处理
if not stats['has_balance'] and stats['deposit'] == 0 and stats['withdrawal'] == 0:
continue
balance = stats['balance']
deposit = stats['deposit']
withdrawal = stats['withdrawal']
# 计算利润
prev_balance = prev_balance_map.get(date_str, 0.0)
profit = balance - deposit - withdrawal - prev_balance
# 转换时间戳
date_obj = datetime.strptime(date_str, '%Y-%m-%d')
time_timestamp = int(date_obj.timestamp())
account_data = {
'st_id': st_id,
'k_id': k_id,
'balance': balance,
'withdrawal': withdrawal,
'deposit': deposit,
'other': 0.0, # 暂时为0
'profit': profit,
'time': time_timestamp
}
account_data_list.append(account_data)
return account_data_list
except Exception as e:
logger.error(f"获取Redis账户信息失败: k_id={k_id}, error={e}")
return []
def _get_previous_balances(self, redis_funds: Dict, sorted_dates: List[str]) -> Dict[str, float]:
"""获取前一天的余额"""
prev_balance_map = {}
prev_date = None
for date_str in sorted_dates:
# 查找前一天的余额
if prev_date:
for fund_key, fund_json in redis_funds.items():
try:
fund_data = json.loads(fund_json)
if (fund_data.get('lz_time') == prev_date and
fund_data.get('lz_type') == 'lz_balance'):
prev_balance_map[date_str] = float(fund_data.get('lz_amount', 0))
break
except:
continue
else:
prev_balance_map[date_str] = 0.0
prev_date = date_str
return prev_balance_map
async def _sync_account_info_batch_to_db(self, account_data_list: List[Dict]) -> bool:
"""批量同步账户信息到数据库(最高效版本)"""

View File

@@ -25,11 +25,6 @@ class BaseSync(ABC):
}
@abstractmethod
async def sync(self):
"""执行同步(兼容旧接口)"""
pass
@abstractmethod
async def sync_batch(self, accounts: Dict[str, Dict]):
"""批量同步数据"""

View File

@@ -5,7 +5,6 @@ import sys
import time
import json
from typing import Dict
import re
import utils.helpers as helpers
from utils.redis_client import RedisClient
@@ -24,8 +23,6 @@ class SyncManager:
self.is_running = True
self.redis_client = RedisClient()
self.sync_interval = SYNC_CONFIG['interval']
self.computer_names = self._get_computer_names()
self.computer_name_pattern = re.compile(COMPUTER_NAME_PATTERN)
# 初始化批量同步工具
self.redis_helper = None
@@ -70,7 +67,7 @@ class SyncManager:
try:
# 获取所有账号(只获取一次)
accounts = self.get_accounts_from_redis()
accounts = self.redis_client.get_accounts_from_redis()
if not accounts:
logger.warning("未获取到任何账号,等待下次同步")
@@ -111,239 +108,6 @@ class SyncManager:
logger.error("完整堆栈跟踪:\n{traceback}", traceback=error_details['traceback'])
await asyncio.sleep(30)
def get_accounts_from_redis(self) -> Dict[str, Dict]:
"""从Redis获取所有计算机名的账号配置"""
try:
accounts_dict = {}
total_keys_processed = 0
# 方法1使用配置的计算机名列表
for computer_name in self.computer_names:
accounts = self._get_accounts_by_computer_name(computer_name)
total_keys_processed += 1
accounts_dict.update(accounts)
# 方法2如果配置的计算机名没有数据尝试自动发现备用方案
if not accounts_dict:
logger.warning("配置的计算机名未找到数据,尝试自动发现...")
accounts_dict = self._discover_all_accounts()
logger.info(f"{len(self.computer_names)} 个计算机名获取到 {len(accounts_dict)} 个账号")
return accounts_dict
except Exception as e:
logger.error(f"获取账户信息失败: {e}")
return {}
def _get_computer_names(self) -> List[str]:
"""获取计算机名列表"""
if ',' in COMPUTER_NAMES:
names = [name.strip() for name in COMPUTER_NAMES.split(',')]
logger.info(f"使用配置的计算机名列表: {names}")
return names
return [COMPUTER_NAMES.strip()]
def _get_accounts_by_computer_name(self, computer_name: str) -> Dict[str, Dict]:
"""获取指定计算机名的账号"""
accounts_dict = {}
try:
# 构建key
redis_key = f"{computer_name}_strategy_api"
# 从Redis获取数据
result = self.redis_client.client.hgetall(redis_key)
if not result:
logger.debug(f"未找到 {redis_key} 的策略API配置")
return {}
logger.info(f"{redis_key} 获取到 {len(result)} 个交易所配置")
for exchange_name, accounts_json in result.items():
try:
accounts = json.loads(accounts_json)
if not accounts:
continue
# 格式化交易所ID
exchange_id = self.format_exchange_id(exchange_name)
for account_id, account_info in accounts.items():
parsed_account = self.parse_account(exchange_id, account_id, account_info)
if parsed_account:
# 添加计算机名标记
parsed_account['computer_name'] = computer_name
accounts_dict[account_id] = parsed_account
except json.JSONDecodeError as e:
logger.error(f"解析交易所 {exchange_name} 的JSON数据失败: {e}")
continue
except Exception as e:
logger.error(f"处理交易所 {exchange_name} 数据异常: {e}")
continue
logger.info(f"{redis_key} 解析到 {len(accounts_dict)} 个账号")
except Exception as e:
logger.error(f"获取计算机名 {computer_name} 的账号失败: {e}")
return accounts_dict
def _discover_all_accounts(self) -> Dict[str, Dict]:
"""自动发现所有匹配的账号key"""
accounts_dict = {}
discovered_keys = []
try:
# 获取所有匹配模式的key
pattern = "*_strategy_api"
cursor = 0
while True:
cursor, keys = self.redis_client.client.scan(cursor, match=pattern, count=100)
for key in keys:
key_str = key.decode('utf-8') if isinstance(key, bytes) else key
discovered_keys.append(key_str)
if cursor == 0:
break
logger.info(f"自动发现 {len(discovered_keys)} 个策略API key")
# 处理每个发现的key
for key_str in discovered_keys:
# 提取计算机名
computer_name = key_str.replace('_strategy_api', '')
# 验证计算机名格式
if self.computer_name_pattern.match(computer_name):
accounts = self._get_accounts_by_computer_name(computer_name)
accounts_dict.update(accounts)
else:
logger.warning(f"跳过不符合格式的计算机名: {computer_name}")
logger.info(f"自动发现共获取到 {len(accounts_dict)} 个账号")
except Exception as e:
logger.error(f"自动发现账号失败: {e}")
return accounts_dict
def _discover_all_accounts(self) -> Dict[str, Dict]:
"""自动发现所有匹配的账号key"""
accounts_dict = {}
discovered_keys = []
try:
# 获取所有匹配模式的key
pattern = "*_strategy_api"
cursor = 0
while True:
cursor, keys = self.redis_client.client.scan(cursor, match=pattern, count=100)
for key in keys:
key_str = key.decode('utf-8') if isinstance(key, bytes) else key
discovered_keys.append(key_str)
if cursor == 0:
break
logger.info(f"自动发现 {len(discovered_keys)} 个策略API key")
# 处理每个发现的key
for key_str in discovered_keys:
# 提取计算机名
computer_name = key_str.replace('_strategy_api', '')
# 验证计算机名格式
if self.computer_name_pattern.match(computer_name):
accounts = self._get_accounts_by_computer_name(computer_name)
accounts_dict.update(accounts)
else:
logger.warning(f"跳过不符合格式的计算机名: {computer_name}")
logger.info(f"自动发现共获取到 {len(accounts_dict)} 个账号")
except Exception as e:
logger.error(f"自动发现账号失败: {e}")
return accounts_dict
def format_exchange_id(self, key: str) -> str:
"""格式化交易所ID"""
key = key.lower().strip()
# 交易所名称映射
exchange_mapping = {
'metatrader': 'mt5',
'binance_spot_test': 'binance',
'binance_spot': 'binance',
'binance': 'binance',
'gate_spot': 'gate',
'okex': 'okx',
'okx': 'okx',
'bybit': 'bybit',
'bybit_spot': 'bybit',
'bybit_test': 'bybit',
'huobi': 'huobi',
'huobi_spot': 'huobi',
'gate': 'gate',
'gateio': 'gate',
'kucoin': 'kucoin',
'kucoin_spot': 'kucoin',
'mexc': 'mexc',
'mexc_spot': 'mexc',
'bitget': 'bitget',
'bitget_spot': 'bitget'
}
normalized_key = exchange_mapping.get(key, key)
# 记录未映射的交易所
if normalized_key == key and key not in exchange_mapping.values():
logger.debug(f"未映射的交易所名称: {key}")
return normalized_key
def parse_account(self, exchange_id: str, account_id: str, account_info: str) -> Optional[Dict]:
"""解析账号信息"""
try:
source_account_info = json.loads(account_info)
# print(source_account_info)
# 基础信息
account_data = {
'exchange_id': exchange_id,
'k_id': account_id,
'st_id': helpers.safe_int(source_account_info.get('st_id'), 0),
'add_time': helpers.safe_int(source_account_info.get('add_time'), 0),
'api_key': source_account_info.get('api_key', ''),
}
return account_data
except json.JSONDecodeError as e:
logger.error(f"解析账号 {account_id} JSON数据失败: {e}, 原始数据: {account_info[:100]}...")
return None
except Exception as e:
logger.error(f"处理账号 {account_id} 数据异常: {e}")
return None
def _group_accounts_by_exchange(self, accounts: Dict[str, Dict]) -> Dict[str, List[Dict]]:
"""按交易所分组账号"""
groups = {}
for account_id, account_info in accounts.items():
exchange_id = account_info.get('exchange_id')
if exchange_id:
if exchange_id not in groups:
groups[exchange_id] = []
groups[exchange_id].append(account_info)
return groups
def _update_stats(self, sync_time: float):

View File

@@ -1,12 +1,9 @@
from .base_sync import BaseSync
from loguru import logger
from typing import List, Dict, Any, Set, Tuple
import json
import asyncio
import utils.helpers as helpers
from datetime import datetime
from sqlalchemy import text, and_, select, delete
from models.orm_models import StrategyPosition
import utils.helpers as helpers
import time
class PositionSyncBatch(BaseSync):
@@ -18,13 +15,15 @@ class PositionSyncBatch(BaseSync):
async def sync_batch(self, accounts: Dict[str, Dict]):
"""批量同步所有账号的持仓数据"""
return
try:
logger.info(f"开始批量同步持仓数据,共 {len(accounts)} 个账号")
start_time = time.time()
# 1. 收集所有账号的持仓数据
all_positions = await self._collect_all_positions(accounts)
all_positions = await self.redis_client._collect_all_positions(accounts)
if not all_positions:
logger.info("无持仓数据需要同步")
@@ -421,91 +420,6 @@ class PositionSyncBatch(BaseSync):
finally:
session.close()
async def _collect_all_positions(self, accounts: Dict[str, Dict]) -> List[Dict]:
"""收集所有账号的持仓数据"""
all_positions = []
try:
# 按交易所分组账号
account_groups = self._group_accounts_by_exchange(accounts)
# 并发收集每个交易所的数据
tasks = []
for exchange_id, account_list in account_groups.items():
task = self._collect_exchange_positions(exchange_id, account_list)
tasks.append(task)
# 等待所有任务完成并合并结果
results = await asyncio.gather(*tasks, return_exceptions=True)
for result in results:
if isinstance(result, list):
all_positions.extend(result)
except Exception as e:
logger.error(f"收集持仓数据失败: {e}")
return all_positions
def _group_accounts_by_exchange(self, accounts: Dict[str, Dict]) -> Dict[str, List[Dict]]:
"""按交易所分组账号"""
groups = {}
for account_id, account_info in accounts.items():
exchange_id = account_info.get('exchange_id')
if exchange_id:
if exchange_id not in groups:
groups[exchange_id] = []
groups[exchange_id].append(account_info)
return groups
async def _collect_exchange_positions(self, exchange_id: str, account_list: List[Dict]) -> List[Dict]:
"""收集某个交易所的持仓数据"""
positions_list = []
try:
tasks = []
for account_info in account_list:
k_id = int(account_info['k_id'])
st_id = account_info.get('st_id', 0)
task = self._get_positions_from_redis(k_id, st_id, exchange_id)
tasks.append(task)
# 并发获取
results = await asyncio.gather(*tasks, return_exceptions=True)
for result in results:
if isinstance(result, list):
positions_list.extend(result)
except Exception as e:
logger.error(f"收集交易所 {exchange_id} 持仓数据失败: {e}")
return positions_list
async def _get_positions_from_redis(self, k_id: int, st_id: int, exchange_id: str) -> List[Dict]:
"""从Redis获取持仓数据"""
try:
redis_key = f"{exchange_id}:positions:{k_id}"
redis_data = self.redis_client.client.hget(redis_key, 'positions')
if not redis_data:
return []
positions = json.loads(redis_data)
# 添加账号信息
for position in positions:
# print(position['symbol'])
position['k_id'] = k_id
position['st_id'] = st_id
position['exchange_id'] = exchange_id
return positions
except Exception as e:
logger.error(f"获取Redis持仓数据失败: k_id={k_id}, error={e}")
return []
def _convert_position_data(self, data: Dict) -> Dict:
"""转换持仓数据格式"""
try:
@@ -531,7 +445,3 @@ class PositionSyncBatch(BaseSync):
logger.error(f"转换持仓数据异常: {data}, error={e}")
return {}
async def sync(self):
"""兼容旧接口"""
accounts = self.get_accounts_from_redis()
await self.sync_batch(accounts)

View File

@@ -1,6 +1,12 @@
import asyncio
import redis
import json
import re
from loguru import logger
from config.settings import REDIS_CONFIG
from config.settings import REDIS_CONFIG, COMPUTER_NAMES, COMPUTER_NAME_PATTERN
import utils.helpers as helpers
from typing import List, Dict, Any, Set, Tuple, Optional
from datetime import datetime, timedelta
class RedisClient:
"""Redis客户端管理器"""
@@ -18,6 +24,8 @@ class RedisClient:
self._pool = None
self._client = None
self._initialized = True
self.computer_names = self._get_computer_names()
self.computer_name_pattern = re.compile(COMPUTER_NAME_PATTERN)
@property
def client(self):
@@ -47,6 +55,447 @@ class RedisClient:
logger.error(f"Redis连接失败: {e}")
raise
def get_accounts_from_redis(self) -> Dict[str, Dict]:
"""从Redis获取所有计算机名的账号配置"""
try:
accounts_dict = {}
total_keys_processed = 0
# 方法1使用配置的计算机名列表
for computer_name in self.computer_names:
accounts = self._get_accounts_by_computer_name(computer_name)
total_keys_processed += 1
accounts_dict.update(accounts)
# 方法2如果配置的计算机名没有数据尝试自动发现备用方案
if not accounts_dict:
logger.warning("配置的计算机名未找到数据,尝试自动发现...")
accounts_dict = self._discover_all_accounts()
logger.info(f"{len(self.computer_names)} 个计算机名获取到 {len(accounts_dict)} 个账号")
return accounts_dict
except Exception as e:
logger.error(f"获取账户信息失败: {e}")
return {}
def _get_computer_names(self) -> List[str]:
"""获取计算机名列表"""
if ',' in COMPUTER_NAMES:
names = [name.strip() for name in COMPUTER_NAMES.split(',')]
logger.info(f"使用配置的计算机名列表: {names}")
return names
return [COMPUTER_NAMES.strip()]
def _get_accounts_by_computer_name(self, computer_name: str) -> Dict[str, Dict]:
"""获取指定计算机名的账号"""
accounts_dict = {}
try:
# 构建key
redis_key = f"{computer_name}_strategy_api"
# 从Redis获取数据
result = self.client.hgetall(redis_key)
if not result:
logger.debug(f"未找到 {redis_key} 的策略API配置")
return {}
# logger.info(f"从 {redis_key} 获取到 {len(result)} 个交易所配置")
for exchange_name, accounts_json in result.items():
try:
accounts = json.loads(accounts_json)
if not accounts:
continue
# 格式化交易所ID
exchange_id = self.format_exchange_id(exchange_name)
for account_id, account_info in accounts.items():
parsed_account = self.parse_account(exchange_id, account_id, account_info)
if parsed_account:
# 添加计算机名标记
parsed_account['computer_name'] = computer_name
accounts_dict[account_id] = parsed_account
except json.JSONDecodeError as e:
logger.error(f"解析交易所 {exchange_name} 的JSON数据失败: {e}")
continue
except Exception as e:
logger.error(f"处理交易所 {exchange_name} 数据异常: {e}")
continue
logger.info(f"{redis_key} 解析到 {len(accounts_dict)} 个账号")
except Exception as e:
logger.error(f"获取计算机名 {computer_name} 的账号失败: {e}")
return accounts_dict
def _discover_all_accounts(self) -> Dict[str, Dict]:
"""自动发现所有匹配的账号key"""
accounts_dict = {}
discovered_keys = []
try:
# 获取所有匹配模式的key
pattern = "*_strategy_api"
cursor = 0
while True:
cursor, keys = self.client.scan(cursor, match=pattern, count=100)
for key in keys:
key_str = key.decode('utf-8') if isinstance(key, bytes) else key
discovered_keys.append(key_str)
if cursor == 0:
break
logger.info(f"自动发现 {len(discovered_keys)} 个策略API key")
# 处理每个发现的key
for key_str in discovered_keys:
# 提取计算机名
computer_name = key_str.replace('_strategy_api', '')
# 验证计算机名格式
if self.computer_name_pattern.match(computer_name):
accounts = self._get_accounts_by_computer_name(computer_name)
accounts_dict.update(accounts)
else:
logger.warning(f"跳过不符合格式的计算机名: {computer_name}")
logger.info(f"自动发现共获取到 {len(accounts_dict)} 个账号")
except Exception as e:
logger.error(f"自动发现账号失败: {e}")
return accounts_dict
def format_exchange_id(self, key: str) -> str:
"""格式化交易所ID"""
key = key.lower().strip()
# 交易所名称映射
exchange_mapping = {
'metatrader': 'mt5',
'binance_spot_test': 'binance',
'binance_spot': 'binance',
'binance': 'binance',
'gate_spot': 'gate',
'okex': 'okx',
'okx': 'okx',
'bybit': 'bybit',
'bybit_spot': 'bybit',
'bybit_test': 'bybit',
'huobi': 'huobi',
'huobi_spot': 'huobi',
'gate': 'gate',
'gateio': 'gate',
'kucoin': 'kucoin',
'kucoin_spot': 'kucoin',
'mexc': 'mexc',
'mexc_spot': 'mexc',
'bitget': 'bitget',
'bitget_spot': 'bitget'
}
normalized_key = exchange_mapping.get(key, key)
# 记录未映射的交易所
if normalized_key == key and key not in exchange_mapping.values():
logger.debug(f"未映射的交易所名称: {key}")
return normalized_key
def parse_account(self, exchange_id: str, account_id: str, account_info: str) -> Optional[Dict]:
"""解析账号信息"""
try:
source_account_info = json.loads(account_info)
# print(source_account_info)
# 基础信息
account_data = {
'exchange_id': exchange_id,
'k_id': account_id,
'st_id': helpers.safe_int(source_account_info.get('st_id'), 0),
'add_time': helpers.safe_int(source_account_info.get('add_time'), 0),
'api_key': source_account_info.get('api_key', ''),
}
return account_data
except json.JSONDecodeError as e:
logger.error(f"解析账号 {account_id} JSON数据失败: {e}, 原始数据: {account_info[:100]}...")
return None
except Exception as e:
logger.error(f"处理账号 {account_id} 数据异常: {e}")
return None
def _group_accounts_by_exchange(self, accounts: Dict[str, Dict]) -> Dict[str, List[Dict]]:
"""按交易所分组账号"""
groups = {}
for account_id, account_info in accounts.items():
exchange_id = account_info.get('exchange_id')
if exchange_id:
if exchange_id not in groups:
groups[exchange_id] = []
groups[exchange_id].append(account_info)
return groups
async def _collect_all_positions(self, accounts: Dict[str, Dict]) -> List[Dict]:
"""收集所有账号的持仓数据"""
all_positions = []
try:
# 按交易所分组账号
account_groups = self._group_accounts_by_exchange(accounts)
# 并发收集每个交易所的数据
tasks = []
for exchange_id, account_list in account_groups.items():
task = self._collect_exchange_positions(exchange_id, account_list)
tasks.append(task)
# 等待所有任务完成并合并结果
results = await asyncio.gather(*tasks, return_exceptions=True)
for result in results:
if isinstance(result, list):
all_positions.extend(result)
except Exception as e:
logger.error(f"收集持仓数据失败: {e}")
return all_positions
async def _collect_exchange_positions(self, exchange_id: str, account_list: List[Dict]) -> List[Dict]:
"""收集某个交易所的持仓数据"""
positions_list = []
try:
tasks = []
for account_info in account_list:
k_id = int(account_info['k_id'])
st_id = account_info.get('st_id', 0)
task = self._get_positions_from_redis(k_id, st_id, exchange_id)
tasks.append(task)
# 并发获取
results = await asyncio.gather(*tasks, return_exceptions=True)
for result in results:
if isinstance(result, list):
positions_list.extend(result)
except Exception as e:
logger.error(f"收集交易所 {exchange_id} 持仓数据失败: {e}")
return positions_list
async def _get_positions_from_redis(self, k_id: int, st_id: int, exchange_id: str) -> List[Dict]:
"""从Redis获取持仓数据"""
try:
redis_key = f"{exchange_id}:positions:{k_id}"
redis_data = self.client.hget(redis_key, 'positions')
if not redis_data:
return []
positions = json.loads(redis_data)
# 添加账号信息
for position in positions:
# print(position['symbol'])
position['k_id'] = k_id
position['st_id'] = st_id
position['exchange_id'] = exchange_id
return positions
except Exception as e:
logger.error(f"获取Redis持仓数据失败: k_id={k_id}, error={e}")
return []
async def _collect_all_account_data(self, accounts: Dict[str, Dict]) -> List[Dict]:
"""收集所有账号的账户信息数据"""
all_account_data = []
try:
# 按交易所分组账号
account_groups = self._group_accounts_by_exchange(accounts)
# 并发收集每个交易所的数据
tasks = []
for exchange_id, account_list in account_groups.items():
task = self._collect_exchange_account_data(exchange_id, account_list)
tasks.append(task)
# 等待所有任务完成并合并结果
results = await asyncio.gather(*tasks, return_exceptions=True)
for result in results:
if isinstance(result, list):
all_account_data.extend(result)
logger.info(f"收集到 {len(all_account_data)} 条账户信息记录")
except Exception as e:
logger.error(f"收集账户信息数据失败: {e}")
return all_account_data
async def _collect_exchange_account_data(self, exchange_id: str, account_list: List[Dict]) -> List[Dict]:
"""收集某个交易所的账户信息数据"""
account_data_list = []
try:
for account_info in account_list:
k_id = int(account_info['k_id'])
st_id = account_info.get('st_id', 0)
# 从Redis获取账户信息数据
account_data = await self._get_account_info_from_redis(k_id, st_id, exchange_id)
account_data_list.extend(account_data)
logger.debug(f"交易所 {exchange_id}: 收集到 {len(account_data_list)} 条账户信息")
except Exception as e:
logger.error(f"收集交易所 {exchange_id} 账户信息失败: {e}")
return account_data_list
async def _get_account_info_from_redis(self, k_id: int, st_id: int, exchange_id: str) -> List[Dict]:
"""从Redis获取账户信息数据批量优化版本"""
try:
redis_key = f"{exchange_id}:balance:{k_id}"
redis_funds = self.client.hgetall(redis_key)
if not redis_funds:
return []
# 按天统计数据
from config.settings import SYNC_CONFIG
recent_days = SYNC_CONFIG['recent_days']
today = datetime.now()
date_stats = {}
# 收集所有日期的数据
for fund_key, fund_json in redis_funds.items():
try:
fund_data = json.loads(fund_json)
date_str = fund_data.get('lz_time', '')
lz_type = fund_data.get('lz_type', '')
if not date_str or lz_type not in ['lz_balance', 'deposit', 'withdrawal']:
continue
# 只处理最近N天的数据
date_obj = datetime.strptime(date_str, '%Y-%m-%d')
if (today - date_obj).days > recent_days:
continue
if date_str not in date_stats:
date_stats[date_str] = {
'balance': 0.0,
'deposit': 0.0,
'withdrawal': 0.0,
'has_balance': False
}
lz_amount = float(fund_data.get('lz_amount', 0))
if lz_type == 'lz_balance':
date_stats[date_str]['balance'] = lz_amount
date_stats[date_str]['has_balance'] = True
elif lz_type == 'deposit':
date_stats[date_str]['deposit'] += lz_amount
elif lz_type == 'withdrawal':
date_stats[date_str]['withdrawal'] += lz_amount
except (json.JSONDecodeError, ValueError) as e:
logger.debug(f"解析Redis数据失败: {fund_key}, error={e}")
continue
# 转换为账户信息数据
account_data_list = []
sorted_dates = sorted(date_stats.keys())
# 获取前一天余额用于计算利润
prev_balance_map = self._get_previous_balances(redis_funds, sorted_dates)
for date_str in sorted_dates:
stats = date_stats[date_str]
# 如果没有余额数据但有充提数据,仍然处理
if not stats['has_balance'] and stats['deposit'] == 0 and stats['withdrawal'] == 0:
continue
balance = stats['balance']
deposit = stats['deposit']
withdrawal = stats['withdrawal']
# 计算利润
prev_balance = prev_balance_map.get(date_str, 0.0)
profit = balance - deposit - withdrawal - prev_balance
# 转换时间戳
date_obj = datetime.strptime(date_str, '%Y-%m-%d')
time_timestamp = int(date_obj.timestamp())
account_data = {
'st_id': st_id,
'k_id': k_id,
'balance': balance,
'withdrawal': withdrawal,
'deposit': deposit,
'other': 0.0, # 暂时为0
'profit': profit,
'time': time_timestamp
}
account_data_list.append(account_data)
return account_data_list
except Exception as e:
logger.error(f"获取Redis账户信息失败: k_id={k_id}, error={e}")
return []
def _get_previous_balances(self, redis_funds: Dict, sorted_dates: List[str]) -> Dict[str, float]:
"""获取前一天的余额"""
prev_balance_map = {}
prev_date = None
for date_str in sorted_dates:
# 查找前一天的余额
if prev_date:
for fund_key, fund_json in redis_funds.items():
try:
fund_data = json.loads(fund_json)
if (fund_data.get('lz_time') == prev_date and
fund_data.get('lz_type') == 'lz_balance'):
prev_balance_map[date_str] = float(fund_data.get('lz_amount', 0))
break
except:
continue
else:
prev_balance_map[date_str] = 0.0
prev_date = date_str
return prev_balance_map
def close(self):
"""关闭连接池"""
if self._pool: