diff --git a/src/example_trade.py b/src/example_trade.py index 8f02945..15eb406 100644 --- a/src/example_trade.py +++ b/src/example_trade.py @@ -57,23 +57,25 @@ if __name__ == "__main__": positions = get_positions(STRATEGY) print("当前持仓:", positions) # 模拟输出: + # {'data': [], 'success': True} # 示例:买入中国银行1000股,价格3.45 - result = buy("601988.SH", 3.45, 1000, STRATEGY) + result = buy("601988.SH", 3.45, 3000, STRATEGY) print("买入结果:", result) # 模拟输出: + #{'data': {'message': '模拟买入 - 代码: 601988.SH, 价格: 3.45, 数量: 3000', 'order_id': 'simulation'}, 'success': True} # 示例:卖出中国银行1000股,价格3.48 result = sell("601988.SH", 3.48, 1000, STRATEGY) print("卖出结果:", result) # 模拟输出: - + # {'data': {'message': '模拟卖出 - 代码: 601988.SH, 价格: 3.48, 数量: 1000', 'order_id': 'simulation'}, 'success': True} # 示例:再次查询持仓变化 positions = get_positions(STRATEGY) print("交易后持仓:", positions) # 模拟输出: - + # {'data': [{'601988.SH': {'closeable_amount': 2000, 'total_amount': 2000}}], 'success': True} \ No newline at end of file