pyqqq 0.12.172__tar.gz → 0.12.174__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyqqq might be problematic. Click here for more details.
- {pyqqq-0.12.172 → pyqqq-0.12.174}/PKG-INFO +1 -1
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyproject.toml +1 -1
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/backtest/broker.py +26 -8
- {pyqqq-0.12.172 → pyqqq-0.12.174}/README.md +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/ai/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/ai/daily.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/ai/domestic.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/ai/market_schedule.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/ai/minute.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/backtest/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/backtest/environment.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/backtest/logger.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/backtest/positionprovider.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/backtest/strategy.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/backtest/utils.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/backtest/wallclock.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/ebest/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/ebest/domestic_stock.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/ebest/oauth.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/ebest/simple.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/ebest/tr_client.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/helper.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/kis/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/kis/domestic_stock.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/kis/oauth.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/kis/overseas_stock.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/kis/simple.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/kis/simple_overseas.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/kis/tr_client.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/multiprocess_tracker.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/brokerage/tracker.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/config.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/daily.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/domestic.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/index.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/minutes.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/overseas.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/realtime.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/ticks.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/data/us_stocks.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/datatypes.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/executors/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/executors/hook.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/__init__.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/api_client.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/array.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/casting.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/compute.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/copycat.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/daily_tickers.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/display.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/kvstore.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/limiter.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/local_cache.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/logger.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/market_schedule.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/mock_api.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/position_classifier.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/retry.py +0 -0
- {pyqqq-0.12.172 → pyqqq-0.12.174}/pyqqq/utils/singleton.py +0 -0
|
@@ -121,9 +121,13 @@ class BaseBroker(ABC):
|
|
|
121
121
|
raise NotImplementedError
|
|
122
122
|
|
|
123
123
|
@abstractmethod
|
|
124
|
-
def get_pending_orders(
|
|
124
|
+
def get_pending_orders(
|
|
125
|
+
self,
|
|
126
|
+
exchanges: List[OrderExchange] = [OrderExchange.KRX]
|
|
127
|
+
) -> List[StockOrder]:
|
|
125
128
|
"""미체결된 모든 주문을 조회합니다.
|
|
126
|
-
|
|
129
|
+
Args:
|
|
130
|
+
exchanges (List[OrderExchange], optional): 조회할 거래소 리스트 (기본값: [OrderExchange.KRX])
|
|
127
131
|
Returns:
|
|
128
132
|
List[StockOrder]: 미체결 주문 객체 리스트
|
|
129
133
|
|
|
@@ -326,12 +330,16 @@ class TradingBroker(BaseBroker):
|
|
|
326
330
|
result = self.data_api.get_orderbook(code, data_exchange=DataExchange.KRX)
|
|
327
331
|
return result
|
|
328
332
|
|
|
329
|
-
def get_pending_orders(self):
|
|
330
|
-
return self.trading_api.get_pending_orders()
|
|
333
|
+
def get_pending_orders(self, exchanges: List[OrderExchange] = [OrderExchange.KRX]):
|
|
334
|
+
return self.trading_api.get_pending_orders(exchanges)
|
|
331
335
|
|
|
332
|
-
def _get_pending_order(
|
|
333
|
-
|
|
334
|
-
|
|
336
|
+
def _get_pending_order(
|
|
337
|
+
self,
|
|
338
|
+
order_no: str,
|
|
339
|
+
exchanges: List[OrderExchange] = [OrderExchange.KRX],
|
|
340
|
+
) -> StockOrder | None:
|
|
341
|
+
orders = self.get_pending_orders(exchanges=exchanges)
|
|
342
|
+
return next((o for o in orders if o.order_no == order_no), None)
|
|
335
343
|
|
|
336
344
|
def get_positions(self):
|
|
337
345
|
"""
|
|
@@ -365,7 +373,16 @@ class TradingBroker(BaseBroker):
|
|
|
365
373
|
return self.trading_api.cancel_order(order.asset_code, order_no, quantity)
|
|
366
374
|
else:
|
|
367
375
|
raise ValueError(f"order not found: {order_no}")
|
|
376
|
+
|
|
377
|
+
elif isinstance(self.trading_api, KISSimpleDomesticStock):
|
|
378
|
+
order = self._get_pending_order(order_no, exchanges=[OrderExchange.KRX, OrderExchange.NXT, OrderExchange.SOR])
|
|
379
|
+
if order is not None:
|
|
380
|
+
self.logger.debug(f"cancel_order: {order_no} {quantity} {order.exchange}")
|
|
381
|
+
return self.trading_api.cancel_order(org_order_no=order_no, quantity=quantity, exchange=order.exchange)
|
|
382
|
+
else:
|
|
383
|
+
raise ValueError(f"order not found: {order_no}")
|
|
368
384
|
else:
|
|
385
|
+
# ebest simple에서는 exchange를 사용하지 않음
|
|
369
386
|
self.logger.debug(f"cancel_order: {order_no} {quantity}")
|
|
370
387
|
return self.trading_api.cancel_order(order_no, quantity)
|
|
371
388
|
|
|
@@ -765,7 +782,8 @@ class MockBroker(BaseBroker):
|
|
|
765
782
|
df = _exclude_today(df)
|
|
766
783
|
return df
|
|
767
784
|
|
|
768
|
-
def get_pending_orders(self):
|
|
785
|
+
def get_pending_orders(self, exchanges: List[OrderExchange] = [OrderExchange.KRX]):
|
|
786
|
+
# MockBroker 에서는 SOR, NXT 주문을 현재 구분하지 않음.
|
|
769
787
|
return self.pending_orders
|
|
770
788
|
|
|
771
789
|
def get_positions(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|