fix: overseas order hardcoded price=0 causes VTS market order rejection #149

Closed
opened 2026-02-18 23:51:29 +09:00 by agentson · 0 comments
Collaborator

문제

KIS VTS(모의투자)에서 해외주식 주문 시 모의투자 주문처리가 안되었습니다(지정가만 가능한 상품입니다) 에러 발생.

근본 원인

trading_cycle() (line 513)과 run_daily_session() (line 922) 모두에서 해외주식 주문 시 price=0.0 하드코딩:

result = await overseas_broker.send_overseas_order(
    exchange_code=market.exchange_code,
    stock_code=stock_code,
    order_type=decision.action,
    quantity=quantity,
    price=0.0,  # market order ← 문제!
)

KIS VTS는 해외주식 모의투자에서 시장가(ORD_DVSN="01") 주문을 거부하고 지정가만 허용.

수정 방향

  • trading_cycle(): price=0.0price=current_price
  • run_daily_session(): price=0.0price=stock_data["current_price"]

Fix #147에서 이미 current_price를 올바르게 계산하고 있으므로 이 값을 지정가 주문에 사용.

발견 경위

Issue #147 (가격 API 거래소 코드 수정) 이후 주문이 전송되기 시작했으나 KIS VTS가 시장가 주문 거부.

로그 확인:

Overseas order submitted  ✓
Order result: 모의투자 주문처리가 안되었습니다(지정가만 가능한 상품입니다)  ✗
## 문제 KIS VTS(모의투자)에서 해외주식 주문 시 `모의투자 주문처리가 안되었습니다(지정가만 가능한 상품입니다)` 에러 발생. ## 근본 원인 `trading_cycle()` (line 513)과 `run_daily_session()` (line 922) 모두에서 해외주식 주문 시 `price=0.0` 하드코딩: ```python result = await overseas_broker.send_overseas_order( exchange_code=market.exchange_code, stock_code=stock_code, order_type=decision.action, quantity=quantity, price=0.0, # market order ← 문제! ) ``` KIS VTS는 해외주식 모의투자에서 시장가(ORD_DVSN="01") 주문을 거부하고 지정가만 허용. ## 수정 방향 - `trading_cycle()`: `price=0.0` → `price=current_price` - `run_daily_session()`: `price=0.0` → `price=stock_data["current_price"]` Fix #147에서 이미 `current_price`를 올바르게 계산하고 있으므로 이 값을 지정가 주문에 사용. ## 발견 경위 Issue #147 (가격 API 거래소 코드 수정) 이후 주문이 전송되기 시작했으나 KIS VTS가 시장가 주문 거부. 로그 확인: ``` Overseas order submitted ✓ Order result: 모의투자 주문처리가 안되었습니다(지정가만 가능한 상품입니다) ✗ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#149