diff --git a/src/broker/overseas.py b/src/broker/overseas.py index 3d37acb..fe9d448 100644 --- a/src/broker/overseas.py +++ b/src/broker/overseas.py @@ -230,7 +230,9 @@ class OverseasBroker: session = self._broker._get_session() # Virtual trading TR_IDs for overseas orders - tr_id = "VTTT1002U" if order_type == "BUY" else "VTTT1006U" + # Source: 한국투자증권 오픈API 전체문서 (20260221) — '해외주식 주문' 시트 + # VTTT1002U: 모의투자 미국 매수, VTTT1001U: 모의투자 미국 매도 + tr_id = "VTTT1002U" if order_type == "BUY" else "VTTT1001U" body = { "CANO": self._broker._account_no, diff --git a/tests/test_overseas_broker.py b/tests/test_overseas_broker.py index 620b98d..08f7fb5 100644 --- a/tests/test_overseas_broker.py +++ b/tests/test_overseas_broker.py @@ -414,7 +414,7 @@ class TestSendOverseasOrder: @pytest.mark.asyncio async def test_sell_limit_order(self, overseas_broker: OverseasBroker) -> None: - """Limit sell order should use VTTT1006U and ORD_DVSN=00.""" + """Limit sell order should use VTTT1001U and ORD_DVSN=00.""" mock_resp = AsyncMock() mock_resp.status = 200 mock_resp.json = AsyncMock(return_value={"rt_cd": "0"}) @@ -428,7 +428,7 @@ class TestSendOverseasOrder: result = await overseas_broker.send_overseas_order("NYSE", "MSFT", "SELL", 5, price=350.0) assert result["rt_cd"] == "0" - overseas_broker._broker._auth_headers.assert_called_with("VTTT1006U") + overseas_broker._broker._auth_headers.assert_called_with("VTTT1001U") call_args = mock_session.post.call_args body = call_args[1]["json"]