[2026-06-02] 결산 중복과 모의투자 호출 안정화
This commit is contained in:
@@ -31,10 +31,14 @@ class OrderExecutor:
|
||||
qty: int,
|
||||
reason: str = "",
|
||||
ai_boosted: bool = False,
|
||||
fill_price: float | None = None,
|
||||
) -> dict:
|
||||
"""Submit a market buy and save the opened trade."""
|
||||
try:
|
||||
result = await self.kis.order_buy(ticker, qty)
|
||||
if self.dry_run and fill_price:
|
||||
result = {"entry_price": fill_price}
|
||||
else:
|
||||
result = await self.kis.order_buy(ticker, qty)
|
||||
price = result.get("entry_price", 0)
|
||||
if not price:
|
||||
price = (await self.kis.get_price(ticker))["current"]
|
||||
@@ -64,10 +68,14 @@ class OrderExecutor:
|
||||
name: str,
|
||||
qty: int,
|
||||
reason: str = "",
|
||||
fill_price: float | None = None,
|
||||
) -> dict:
|
||||
"""Submit a market sell and save full or partial exit results."""
|
||||
try:
|
||||
result = await self.kis.order_sell(ticker, qty)
|
||||
if self.dry_run and fill_price:
|
||||
result = {"exit_price": fill_price}
|
||||
else:
|
||||
result = await self.kis.order_sell(ticker, qty)
|
||||
price = result.get("exit_price", 0)
|
||||
if not price:
|
||||
price = (await self.kis.get_price(ticker))["current"]
|
||||
|
||||
Reference in New Issue
Block a user