|
|
@@ -101,18 +101,11 @@ def simulate_t1_trades(data_df, long_trades_df, initial_capital=1000000):
|
|
|
new_exit_price = original_exit_price
|
|
|
t1_adjusted = False
|
|
|
else:
|
|
|
- # 计算新的盈亏
|
|
|
- # 假设使用开盘价卖出
|
|
|
+ # 计算新的盈亏(无手续费)
|
|
|
original_pnl = trade['盈亏金额']
|
|
|
|
|
|
- # 计算手续费(万分之一)
|
|
|
- commission_rate = 0.0001
|
|
|
- open_cost = position_size * entry_price * commission_rate
|
|
|
- close_cost = position_size * new_exit_price * commission_rate
|
|
|
-
|
|
|
- # 新的盈亏
|
|
|
- gross_pnl = (new_exit_price - entry_price) * position_size
|
|
|
- new_pnl = gross_pnl - open_cost - close_cost
|
|
|
+ # 新的盈亏(毛盈亏,无手续费扣除)
|
|
|
+ new_pnl = (new_exit_price - entry_price) * position_size
|
|
|
new_pnl_pct = (new_exit_price - entry_price) / entry_price * 100
|
|
|
|
|
|
# 判断新的退出原因
|