이하영

create database automatically

import pymysql
pymysql.install_as_MySQLdb()
class Collector:
def __init__(self):
\ No newline at end of file
# Default ignored files
/shelf/
/workspace.xml
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="pytest" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/library.iml" filepath="$PROJECT_DIR$/.idea/library.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>
\ No newline at end of file
No preview for this file type
from open_api import *
class CollectorApi():
def __init__(self):
self.open_api=OpenApi()
self.engine_bot=self.open_api.engine_bot
......@@ -2,6 +2,12 @@
db_id="user"
db_pw="password"
db_port="3306"
db_ip="localhost"
# 모의투자 계좌번호
account_no="8147766711"
\ No newline at end of file
test_account_no="8147766711"
# 시뮬레이션을 돌리기 시작할 날짜
start_buying='20190101'
simul_num1=1
simul_name1="AutoBot"+str(simul_num1)+"_Test"
......
def errors(err_code):
err_dict={0:('OP_ERR_NONE','정상처리'),
-10:('OP_ERR_FAIL','실패'),
-100:('OP_ERR_LOGIN','사용자정보교환실패'),
-101:('OP_ERR_CONNECT','서버접속실패'),
-102:('OP_ERR_VERSION','버전처리실패'),
-103:('OP_ERR_FAIRWALL','개인방화벽실패'),
-104:('OP_ERR_MEMORY','메모리보호실패'),
-105:('OP_ERR_INPUT','함수입력값오류'),
-106:('OP_ERR_SOCKET_CLOSED','통신연결종료'),
-200:('OP_ERR_SISE_OVERFLOW','시세조회과부화'),
-201:('OP_ERR_RQ_STRUCT_FAIL','전문작성초기화실패'),
-202:('OP_ERR_RQ_STRING_FAIL','전문작성입력값오류'),
-203:('OP_ERR_NO_DATA','데이터없음'),
-204:('OP_ERR_OVER_MAX_DATA','조회가능한종목수초과'),
-205:('OP_ERR_DATA_RCV_FAIL','데이터수신실패'),
-206:('OP_ERR_OVER_MAX_FID','조회가능한FID수초과'),
-207:('OP_ERR_REAL_CANCEL','실시간해제오류'),
-300:('OP_ERR_ORD_WRONG_INPUT','입력값오류'),
-301:('OP_ERR_ORD_WRONG_ACCNO','계좌비밀번호없음'),
-302:('OP_ERR_OTHER_ACC_USE','타인계좌사용오류'),
-303:('OP_ERR_MIS_2BILL_EXC','주문가격이20억원을초과'),
-304:('OP_ERR_MIS_5BILL_EXC','주문가격이50억원을초과'),
-305:('OP_ERR_MIS_1PER_EXC','주문수량이총발행주수의1 % 초과오류'),
-306:('OP_ERR_MIS_3PER_EXC','주문수량이총발행주수의3 % 초과오류'),
-307:('OP_ERR_SEND_FAIL','주문전송실패'),
-308:('OP_ERR_ORD_OVERFLOW','주문전송과부화'),
-309:('OP_ERR_MIS_300CNT_EXC','주문수량300계약초과'),
-310:('OP_ERR_MIS_500CNT_EXC','주문수량500계약초과'),
-340:('OP_ERR_ORD_WRONG_ACCINFO','계좌정보없음'),
-500:('OP_ERR_ORD_SYMCODE_EMPTY','종목코드없음')
}
result=err_dict[err_code]
return result
\ No newline at end of file
This diff is collapsed. Click to expand it.