pyqqq 0.12.205__tar.gz → 0.12.207__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.205 → pyqqq-0.12.207}/PKG-INFO +1 -1
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyproject.toml +1 -1
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/ebest/domestic_stock.py +9 -7
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/ebest/tr_client.py +12 -3
- {pyqqq-0.12.205 → pyqqq-0.12.207}/README.md +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/__init__.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/backtest/__init__.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/backtest/broker.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/backtest/environment.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/backtest/logger.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/backtest/positionprovider.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/backtest/strategy.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/backtest/utils.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/backtest/wallclock.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/__init__.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/ebest/__init__.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/ebest/oauth.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/ebest/simple.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/helper.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/kis/__init__.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/kis/domestic_stock.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/kis/oauth.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/kis/overseas_stock.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/kis/simple.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/kis/simple_overseas.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/kis/tr_client.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/multiprocess_tracker.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/brokerage/tracker.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/config.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/__init__.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/daily.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/domestic.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/index.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/minutes.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/overseas.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/realtime.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/ticks.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/data/us_stocks.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/datatypes.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/executors/__init__.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/executors/hook.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/__init__.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/api_client.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/array.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/backoff.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/casting.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/compute.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/copycat.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/daily_tickers.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/display.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/indicators.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/kvstore.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/limiter.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/local_cache.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/logger.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/market_schedule.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/mock_api.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/position_classifier.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/retry.py +0 -0
- {pyqqq-0.12.205 → pyqqq-0.12.207}/pyqqq/utils/singleton.py +0 -0
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import datetime as dtm
|
|
3
|
+
import json
|
|
4
|
+
from typing import AsyncGenerator
|
|
5
|
+
|
|
6
|
+
import websockets
|
|
7
|
+
|
|
1
8
|
from pyqqq.brokerage.ebest.oauth import EBestAuth
|
|
2
9
|
from pyqqq.brokerage.ebest.tr_client import (
|
|
3
10
|
EBestTRClient,
|
|
@@ -6,11 +13,6 @@ from pyqqq.brokerage.ebest.tr_client import (
|
|
|
6
13
|
)
|
|
7
14
|
from pyqqq.utils.limiter import CallLimiter
|
|
8
15
|
from pyqqq.utils.market_schedule import get_market_schedule
|
|
9
|
-
from typing import AsyncGenerator
|
|
10
|
-
import asyncio
|
|
11
|
-
import datetime as dtm
|
|
12
|
-
import json
|
|
13
|
-
import websockets
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
class EBestDomesticStock:
|
|
@@ -1246,6 +1248,8 @@ class EBestDomesticStock:
|
|
|
1246
1248
|
|
|
1247
1249
|
async def __on_connect(ws: websockets.WebSocketClientProtocol):
|
|
1248
1250
|
for asset_code in asset_codes:
|
|
1251
|
+
CallLimiter().wait_limit_rate(100, scope="ebest/listen_trade_event")
|
|
1252
|
+
|
|
1249
1253
|
await ws.send(
|
|
1250
1254
|
json.dumps(
|
|
1251
1255
|
{
|
|
@@ -1261,8 +1265,6 @@ class EBestDomesticStock:
|
|
|
1261
1265
|
)
|
|
1262
1266
|
)
|
|
1263
1267
|
|
|
1264
|
-
await asyncio.sleep(0.01)
|
|
1265
|
-
|
|
1266
1268
|
client = EBestTRWebsocketClient(
|
|
1267
1269
|
self.auth,
|
|
1268
1270
|
on_connect=__on_connect,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import datetime as dtm
|
|
2
3
|
import json
|
|
3
4
|
import random
|
|
4
5
|
import ssl
|
|
6
|
+
import traceback
|
|
5
7
|
from enum import Enum
|
|
6
8
|
from typing import AsyncGenerator, Callable
|
|
7
9
|
|
|
@@ -174,17 +176,24 @@ class EBestTRWebsocketClient:
|
|
|
174
176
|
|
|
175
177
|
except websockets.exceptions.ConnectionClosedError:
|
|
176
178
|
self.logger.error(f"{self.session_id}: ConnectionClosedError")
|
|
177
|
-
await asyncio.sleep(
|
|
179
|
+
await asyncio.sleep(1)
|
|
178
180
|
continue
|
|
179
181
|
|
|
180
182
|
except websockets.ConnectionClosed as e:
|
|
181
|
-
await asyncio.sleep(
|
|
183
|
+
await asyncio.sleep(1)
|
|
182
184
|
self.logger.exception(e)
|
|
183
185
|
continue
|
|
184
186
|
|
|
185
187
|
except ssl.SSLZeroReturnError:
|
|
186
188
|
self.logger.error(f"{self.session_id}: SSLZeroReturnError")
|
|
187
|
-
|
|
189
|
+
|
|
190
|
+
if not hasattr(self, "_sslzero_exc_count"):
|
|
191
|
+
self._sslzero_exc_count = 0
|
|
192
|
+
if self._sslzero_exc_count < 3:
|
|
193
|
+
self._sslzero_exc_count += 1
|
|
194
|
+
traceback.print_exc()
|
|
195
|
+
|
|
196
|
+
await asyncio.sleep(random.uniform(1, 2))
|
|
188
197
|
continue
|
|
189
198
|
|
|
190
199
|
except TimeoutError as e:
|
|
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
|