tradestocsv.py update

This commit is contained in:
zhangkun9038@dingtalk.com 2025-05-16 12:40:40 +00:00
parent 91bde46bb9
commit 66492da604
2 changed files with 4 additions and 1 deletions

Binary file not shown.

View File

@ -23,8 +23,11 @@ largest_file = max(json_files, key=lambda x: x.stat().st_size)
with open(largest_file) as f:
data = json.load(f)
# 从环境变量中获取策略名称
strategy_name = os.environ.get('STRATEGY_NAME', 'TheForceV7') # 如果未设置环境变量,则使用默认值 'TheForceV7'
# 提取交易记录
trades = data['strategy']['TheForceV7']['trades']
trades = data['strategy'][strategy_name]['trades']
trades_df = pd.DataFrame(trades)
# 选择关键字段