pyqqq 0.12.173__py3-none-any.whl → 0.12.175__py3-none-any.whl
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/backtest/broker.py
CHANGED
|
@@ -339,7 +339,7 @@ class TradingBroker(BaseBroker):
|
|
|
339
339
|
exchanges: List[OrderExchange] = [OrderExchange.KRX],
|
|
340
340
|
) -> StockOrder | None:
|
|
341
341
|
orders = self.get_pending_orders(exchanges=exchanges)
|
|
342
|
-
return next((o for o in orders if o
|
|
342
|
+
return next((o for o in orders if o.order_no == order_no), None)
|
|
343
343
|
|
|
344
344
|
def get_positions(self):
|
|
345
345
|
"""
|
|
@@ -373,7 +373,16 @@ class TradingBroker(BaseBroker):
|
|
|
373
373
|
return self.trading_api.cancel_order(order.asset_code, order_no, quantity)
|
|
374
374
|
else:
|
|
375
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}")
|
|
376
384
|
else:
|
|
385
|
+
# ebest simple에서는 exchange를 사용하지 않음
|
|
377
386
|
self.logger.debug(f"cancel_order: {order_no} {quantity}")
|
|
378
387
|
return self.trading_api.cancel_order(order_no, quantity)
|
|
379
388
|
|
pyqqq/data/realtime.py
CHANGED
|
@@ -54,9 +54,9 @@ def get_all_last_trades(codes: List[str] = None, exchange: str = "KRX"):
|
|
|
54
54
|
|
|
55
55
|
"""
|
|
56
56
|
|
|
57
|
-
params =
|
|
57
|
+
params = {"exchange": exchange}
|
|
58
58
|
if codes:
|
|
59
|
-
params
|
|
59
|
+
params["codes"] = ",".join(codes) if isinstance(codes, list) else codes
|
|
60
60
|
|
|
61
61
|
r = send_request("GET", f"{c.PYQQQ_API_URL}/domestic-stock/trades", params=params)
|
|
62
62
|
raise_for_status(r)
|
|
@@ -147,10 +147,7 @@ class TickEventListener:
|
|
|
147
147
|
"""
|
|
148
148
|
틱데이터 이벤트 리스너를 시작합니다
|
|
149
149
|
"""
|
|
150
|
-
self.tasks = [
|
|
151
|
-
asyncio.create_task(self.connect_ws()),
|
|
152
|
-
asyncio.create_task(self.health_ping())
|
|
153
|
-
]
|
|
150
|
+
self.tasks = [asyncio.create_task(self.connect_ws()), asyncio.create_task(self.health_ping())]
|
|
154
151
|
|
|
155
152
|
async def stop(self):
|
|
156
153
|
"""
|
|
@@ -5,7 +5,7 @@ pyqqq/ai/domestic.py,sha256=FiJNInRlhcnxG7Jxmz2hDvaLhS8_jn-JFpQMze8Ch9s,1888
|
|
|
5
5
|
pyqqq/ai/market_schedule.py,sha256=8HiivwC-xI2EKr8lXS_g4mTj2LYpCQ2QfZsJmIq61O0,818
|
|
6
6
|
pyqqq/ai/minute.py,sha256=C0sTVkBY4-Vuj8Q9VZ7d9kZYAv963FUX4k3vIvhetng,1754
|
|
7
7
|
pyqqq/backtest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
pyqqq/backtest/broker.py,sha256=
|
|
8
|
+
pyqqq/backtest/broker.py,sha256=xHqHVXaurnxnSM1ulitTt3Uf-iy5fqa2B3MINGqN_6k,67646
|
|
9
9
|
pyqqq/backtest/environment.py,sha256=bkdlwG9MynuNL1u7f0cQ1L271cnPqJ7gX89EYwl8oOg,9313
|
|
10
10
|
pyqqq/backtest/logger.py,sha256=BmoEMjUU76z8rZtMCYCwbspD3AVaHJrdbbT1EAFgrAE,3294
|
|
11
11
|
pyqqq/backtest/positionprovider.py,sha256=wrR7Bntg28Q5_vGQV6XNzxe-SYoO9_GLcV9gDVEDAN4,4164
|
|
@@ -35,7 +35,7 @@ pyqqq/data/domestic.py,sha256=2FOYxDGw2W7DGwY61p3uGFb4IWqWUKiNdR3RlewjkCU,30352
|
|
|
35
35
|
pyqqq/data/index.py,sha256=d5b-8a7IXu7yNJWt1tIe1Mj83NW0ZnQq8nsj2Sl3Gx8,6988
|
|
36
36
|
pyqqq/data/minutes.py,sha256=b-bqThP39t7V5io5dzI953bi1oWrUH3uie8GsFS7HUY,14727
|
|
37
37
|
pyqqq/data/overseas.py,sha256=yx7tCZHW8AvjIbtrP4dqIeC6wseRSzbg5ag3dm6H0LY,1234
|
|
38
|
-
pyqqq/data/realtime.py,sha256=
|
|
38
|
+
pyqqq/data/realtime.py,sha256=yK51V-CtMRAEEwRpbWaI5LA0MNb7LloBWG4IEOLbkU8,15065
|
|
39
39
|
pyqqq/data/ticks.py,sha256=DXioiKBsGTzwXyvEH0lpm8t5g-1nHIOLKMXoSrE1Rko,4127
|
|
40
40
|
pyqqq/data/us_stocks.py,sha256=jXR9dQEVigrwTLEpX1aX1_AQvOlBopW265gwx8Nq8OA,12959
|
|
41
41
|
pyqqq/datatypes.py,sha256=KnanWzat6w5w0vNvKHsWt9VOBwf9gh0njdt36PJBgXc,8370
|
|
@@ -58,6 +58,6 @@ pyqqq/utils/mock_api.py,sha256=7EsaVQ9mOVZQAqtQW24isPnk9QTbJII7x3guhFyEMAE,10569
|
|
|
58
58
|
pyqqq/utils/position_classifier.py,sha256=EaomByAWM2lVuYow5OFdJNrN64Fpukhj-lhFkjYpjeo,14908
|
|
59
59
|
pyqqq/utils/retry.py,sha256=4mw9MQvgSBC8bTLvDauaCEI5N9tL8upHCk8rSfaVRG8,2066
|
|
60
60
|
pyqqq/utils/singleton.py,sha256=m6NZ8fwVDpI6U-gUUihMPgVK_NkDh-Z1NSAtjisrpjY,810
|
|
61
|
-
pyqqq-0.12.
|
|
62
|
-
pyqqq-0.12.
|
|
63
|
-
pyqqq-0.12.
|
|
61
|
+
pyqqq-0.12.175.dist-info/METADATA,sha256=Y7g2F0GQsWw9490TuDnEn8XUEMxwqj7k9-tg-NW5phU,1664
|
|
62
|
+
pyqqq-0.12.175.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
63
|
+
pyqqq-0.12.175.dist-info/RECORD,,
|
|
File without changes
|