@@ -779,6 +779,7 @@ def _execute_buy_impl(
779779 1 ,
780780 "BUY" ,
781781 avg_daily_volume = avg_daily_volume ,
782+ symbol = symbol ,
782783 )
783784 sizing_entry_price = float (sizing_costs .get ("execution_price" , price ) or price )
784785
@@ -867,7 +868,9 @@ def _execute_buy_impl(
867868 return {"success" : False , "reason" : perf_check .get ("reason" , "성과 열화로 매수 중단" )}
868869
869870 # 거래 비용 계산 (avg_daily_volume 있으면 거래량 기반 동적 슬리피지 적용)
870- costs = self .risk_manager .calculate_transaction_costs (price , quantity , "BUY" , avg_daily_volume = avg_daily_volume )
871+ costs = self .risk_manager .calculate_transaction_costs (
872+ price , quantity , "BUY" , avg_daily_volume = avg_daily_volume , symbol = symbol ,
873+ )
871874 available_cash = capital if available_cash is None else available_cash
872875 estimated_fill_price = float (costs .get ("execution_price" , price ) or price )
873876
@@ -984,7 +987,7 @@ def _execute_buy_impl(
984987 order .transition (OrderStatus .ACKED )
985988 # Paper에서는 슬리피지 적용 후 즉시 FILLED (simulated fill)
986989 costs = self .risk_manager .calculate_transaction_costs (
987- expected_price , quantity , "BUY" , avg_daily_volume = avg_daily_volume ,
990+ expected_price , quantity , "BUY" , avg_daily_volume = avg_daily_volume , symbol = symbol ,
988991 )
989992 fill_price = costs ["execution_price" ]
990993 order .transition (OrderStatus .FILLED , fill_qty = quantity , fill_price = fill_price )
@@ -994,7 +997,7 @@ def _execute_buy_impl(
994997
995998 if self .mode == "live" :
996999 costs = self .risk_manager .calculate_transaction_costs (
997- fill_price , quantity , "BUY" , avg_daily_volume = avg_daily_volume ,
1000+ fill_price , quantity , "BUY" , avg_daily_volume = avg_daily_volume , symbol = symbol ,
9981001 )
9991002
10001003 stop_loss = self .risk_manager .calculate_stop_loss (
@@ -1128,7 +1131,7 @@ def _execute_buy_quantity_impl(
11281131 return {"success" : False , "reason" : "장 초반/마감 진입 차단 시간대" }
11291132
11301133 costs = self .risk_manager .calculate_transaction_costs (
1131- price , quantity , "BUY" , avg_daily_volume = avg_daily_volume ,
1134+ price , quantity , "BUY" , avg_daily_volume = avg_daily_volume , symbol = symbol ,
11321135 )
11331136 expected_price = float (price )
11341137 fill_price = float (costs ["execution_price" ])
@@ -1232,7 +1235,7 @@ def _execute_buy_quantity_impl(
12321235 OrderGuard .clear (symbol )
12331236 # 체결가 기준 비용 재계산
12341237 costs = self .risk_manager .calculate_transaction_costs (
1235- fill_price , quantity , "BUY" , avg_daily_volume = avg_daily_volume ,
1238+ fill_price , quantity , "BUY" , avg_daily_volume = avg_daily_volume , symbol = symbol ,
12361239 )
12371240 else :
12381241 order .transition (OrderStatus .SUBMITTED )
@@ -1464,6 +1467,7 @@ def _execute_sell_impl(
14641467 "SELL" ,
14651468 avg_daily_volume = avg_daily_volume ,
14661469 avg_price = float (position .avg_price ),
1470+ symbol = symbol ,
14671471 )
14681472 fill_price = float (costs ["execution_price" ])
14691473 order .transition (OrderStatus .SUBMITTED )
@@ -1480,6 +1484,7 @@ def _execute_sell_impl(
14801484 "SELL" ,
14811485 avg_daily_volume = avg_daily_volume ,
14821486 avg_price = float (position .avg_price ),
1487+ symbol = symbol ,
14831488 )
14841489 total_tax = costs ["tax" ] + costs .get ("capital_gains_tax" , 0 )
14851490 pnl = (fill_price - position .avg_price ) * sell_qty - costs ["commission" ] - total_tax
0 commit comments