pyqqq 0.12.200__tar.gz → 0.12.202__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.200 → pyqqq-0.12.202}/PKG-INFO +1 -1
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyproject.toml +1 -1
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/ebest/tr_client.py +14 -19
- {pyqqq-0.12.200 → pyqqq-0.12.202}/README.md +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/__init__.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/backtest/__init__.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/backtest/broker.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/backtest/environment.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/backtest/logger.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/backtest/positionprovider.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/backtest/strategy.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/backtest/utils.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/backtest/wallclock.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/__init__.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/ebest/__init__.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/ebest/domestic_stock.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/ebest/oauth.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/ebest/simple.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/helper.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/kis/__init__.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/kis/domestic_stock.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/kis/oauth.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/kis/overseas_stock.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/kis/simple.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/kis/simple_overseas.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/kis/tr_client.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/multiprocess_tracker.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/brokerage/tracker.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/config.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/__init__.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/daily.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/domestic.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/index.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/minutes.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/overseas.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/realtime.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/ticks.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/data/us_stocks.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/datatypes.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/executors/__init__.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/executors/hook.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/__init__.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/api_client.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/array.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/backoff.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/casting.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/compute.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/copycat.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/daily_tickers.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/display.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/indicators.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/kvstore.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/limiter.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/local_cache.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/logger.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/market_schedule.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/mock_api.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/position_classifier.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/retry.py +0 -0
- {pyqqq-0.12.200 → pyqqq-0.12.202}/pyqqq/utils/singleton.py +0 -0
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
from pyqqq.brokerage.ebest.oauth import EBestAuth
|
|
3
|
-
from pyqqq.utils.logger import get_logger
|
|
4
|
-
from pyqqq.utils.market_schedule import *
|
|
5
|
-
from pyqqq.utils.retry import retry
|
|
6
|
-
from typing import AsyncGenerator, Callable
|
|
7
1
|
import asyncio
|
|
8
2
|
import json
|
|
9
|
-
import ssl
|
|
10
3
|
import random
|
|
4
|
+
import ssl
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing import AsyncGenerator, Callable
|
|
7
|
+
|
|
11
8
|
import requests
|
|
12
9
|
import websockets
|
|
13
10
|
|
|
11
|
+
from pyqqq.brokerage.ebest.oauth import EBestAuth
|
|
12
|
+
from pyqqq.utils.logger import get_logger
|
|
13
|
+
from pyqqq.utils.market_schedule import *
|
|
14
|
+
from pyqqq.utils.retry import retry
|
|
15
|
+
|
|
14
16
|
|
|
15
17
|
class EBestTRClient:
|
|
16
18
|
logger = get_logger(__name__ + ".EBestTRClient")
|
|
@@ -26,18 +28,10 @@ class EBestTRClient:
|
|
|
26
28
|
def __init__(self, auth: EBestAuth, corp_data: dict = None):
|
|
27
29
|
self.auth = auth
|
|
28
30
|
self.corp_data = corp_data
|
|
31
|
+
self.session = requests.Session()
|
|
29
32
|
|
|
30
|
-
@retry(requests.
|
|
31
|
-
def request(
|
|
32
|
-
self,
|
|
33
|
-
path: str,
|
|
34
|
-
tr_cd: str,
|
|
35
|
-
tr_cont: str = "N",
|
|
36
|
-
tr_cont_key: str = "",
|
|
37
|
-
params: dict = None,
|
|
38
|
-
body: dict = None,
|
|
39
|
-
method: str = "POST",
|
|
40
|
-
):
|
|
33
|
+
@retry(requests.RequestException, delay=1)
|
|
34
|
+
def request(self, path: str, tr_cd: str, tr_cont: str = "N", tr_cont_key: str = "", params: dict = None, body: dict = None, method: str = "POST"):
|
|
41
35
|
"""
|
|
42
36
|
TR 요청을 보내고 응답을 받는 메서드
|
|
43
37
|
|
|
@@ -67,13 +61,14 @@ class EBestTRClient:
|
|
|
67
61
|
|
|
68
62
|
url = f"{self.auth.host_url}{path}"
|
|
69
63
|
|
|
70
|
-
r =
|
|
64
|
+
r = self.session.request(method=method, url=url, headers=headers, params=params, json=body)
|
|
71
65
|
|
|
72
66
|
if r.status_code != 200:
|
|
73
67
|
try:
|
|
74
68
|
res_body = r.json()
|
|
75
69
|
if "rsp_cd" in res_body and res_body["rsp_cd"] == "IGW00121":
|
|
76
70
|
self.auth.get_token(refresh=True)
|
|
71
|
+
|
|
77
72
|
except Exception as e:
|
|
78
73
|
self.logger.exception(e)
|
|
79
74
|
|
|
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
|