pyqqq 0.12.193__tar.gz → 0.12.195__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.193 → pyqqq-0.12.195}/PKG-INFO +1 -1
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyproject.toml +1 -1
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/kis/tr_client.py +6 -5
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/tracker.py +18 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/domestic.py +2 -1
- {pyqqq-0.12.193 → pyqqq-0.12.195}/README.md +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/__init__.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/backtest/__init__.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/backtest/broker.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/backtest/environment.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/backtest/logger.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/backtest/positionprovider.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/backtest/strategy.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/backtest/utils.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/backtest/wallclock.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/__init__.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/ebest/__init__.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/ebest/domestic_stock.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/ebest/oauth.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/ebest/simple.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/ebest/tr_client.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/helper.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/kis/__init__.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/kis/domestic_stock.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/kis/oauth.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/kis/overseas_stock.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/kis/simple.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/kis/simple_overseas.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/brokerage/multiprocess_tracker.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/config.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/__init__.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/daily.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/index.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/minutes.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/overseas.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/realtime.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/ticks.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/data/us_stocks.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/datatypes.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/executors/__init__.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/executors/hook.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/__init__.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/api_client.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/array.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/casting.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/compute.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/copycat.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/daily_tickers.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/display.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/kvstore.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/limiter.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/local_cache.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/logger.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/market_schedule.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/mock_api.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/position_classifier.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/retry.py +0 -0
- {pyqqq-0.12.193 → pyqqq-0.12.195}/pyqqq/utils/singleton.py +0 -0
|
@@ -132,21 +132,22 @@ class KISTRWebsocketClient:
|
|
|
132
132
|
yield data
|
|
133
133
|
|
|
134
134
|
except websockets.exceptions.ConnectionClosedError:
|
|
135
|
-
|
|
135
|
+
self.logger.error(f"{self.session_id}: ConnectionClosedError")
|
|
136
136
|
await asyncio.sleep(0.5)
|
|
137
137
|
continue
|
|
138
138
|
|
|
139
139
|
except ConnectionRefusedError:
|
|
140
|
+
self.logger.error(f"{self.session_id}: ConnectionRefusedError")
|
|
140
141
|
await asyncio.sleep(0.5)
|
|
141
142
|
continue
|
|
142
143
|
|
|
143
|
-
except websockets.ConnectionClosed
|
|
144
|
+
except websockets.ConnectionClosed:
|
|
145
|
+
self.logger.error(f"{self.session_id}: ConnectionClosed")
|
|
144
146
|
await asyncio.sleep(0.5)
|
|
145
|
-
self.logger.exception(e)
|
|
146
147
|
continue
|
|
147
148
|
|
|
148
|
-
except ssl.SSLZeroReturnError
|
|
149
|
-
self.logger.
|
|
149
|
+
except ssl.SSLZeroReturnError:
|
|
150
|
+
self.logger.error(f"{self.session_id}: SSLZeroReturnError")
|
|
150
151
|
await asyncio.sleep(0.5)
|
|
151
152
|
continue
|
|
152
153
|
|
|
@@ -31,6 +31,7 @@ class TrackerSocket:
|
|
|
31
31
|
self.stop_event = asyncio.Event()
|
|
32
32
|
self.logger = get_logger(__name__ + ".TrackerSocket")
|
|
33
33
|
self.trading_tracker_counter = 1
|
|
34
|
+
self.only_my_account = True
|
|
34
35
|
self.event_callbacks: Dict[callable] = {}
|
|
35
36
|
|
|
36
37
|
async def start(self):
|
|
@@ -64,6 +65,9 @@ class TrackerSocket:
|
|
|
64
65
|
Args:
|
|
65
66
|
event (OrderEvent): 주문 이벤트 객체
|
|
66
67
|
"""
|
|
68
|
+
if event is None or (self.only_my_account and not self._check_account_match(event.account_no)):
|
|
69
|
+
return
|
|
70
|
+
|
|
67
71
|
self.logger.debug(f"Relay order event: {event}")
|
|
68
72
|
|
|
69
73
|
for callback in self.event_callbacks.values():
|
|
@@ -120,6 +124,20 @@ class TrackerSocket:
|
|
|
120
124
|
|
|
121
125
|
self.task = asyncio.create_task(self._monitor_schedule())
|
|
122
126
|
|
|
127
|
+
def _check_account_match(self, event_account_no):
|
|
128
|
+
my_account_no = f"{self.simple_api.account_no}{self.simple_api.account_product_code}"
|
|
129
|
+
|
|
130
|
+
if event_account_no is not None and my_account_no == event_account_no:
|
|
131
|
+
return True
|
|
132
|
+
else:
|
|
133
|
+
return False
|
|
134
|
+
|
|
135
|
+
def activate_all_account_event(self):
|
|
136
|
+
"""
|
|
137
|
+
내 hts_id에 연동된 모든 계좌의 주문을 수신하도록 설정합니다.
|
|
138
|
+
"""
|
|
139
|
+
self.only_my_account = False
|
|
140
|
+
|
|
123
141
|
|
|
124
142
|
class TradingTracker:
|
|
125
143
|
"""
|
|
@@ -229,7 +229,8 @@ def _isoformat_to_readable(isodate: str) -> str:
|
|
|
229
229
|
return ""
|
|
230
230
|
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
# _get_tickers가 메모이제이션 되어있어서 해당 함수는 캐싱하면 안됨
|
|
233
|
+
# 특히 date가 None으로 쓰는경우가 많은데 캐싱하면 오작동함
|
|
233
234
|
def get_tickers(
|
|
234
235
|
date: Optional[dtm.date] = None,
|
|
235
236
|
market: Optional[str] = None,
|
|
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
|