删除已废弃的文件

This commit is contained in:
fasiondog 2021-04-18 00:14:53 +08:00
parent f429ef3eb0
commit 2e4f51c2fa
3 changed files with 0 additions and 278 deletions

View File

@ -1,56 +0,0 @@
BEGIN TRANSACTION;
CREATE TABLE "stkWeight" (
id INTEGER NOT NULL,
stockid INTEGER,
date INTEGER,
"countAsGift" INTEGER,
"countForSell" INTEGER,
"priceForSell" INTEGER,
bonus INTEGER,
"countOfIncreasement" INTEGER,
"totalCount" INTEGER,
"freeCount" INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(stockid) REFERENCES "Stock" (stockid)
);
CREATE TABLE StockTypeInfo (tickValue NUMERIC, precision INTEGER, id INTEGER PRIMARY KEY, type INTEGER, description VARCHAR(100), tick NUMERIC, minTradeNumber INTEGER, maxTradeNumber INTEGER);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (100,2,0,0,'Block',100,100,1000000);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (0.01,2,1,1,'A股',0.01,100,1000000);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (0.001,3,2,2,'指数',0.001,1,1000000);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (0.001,3,3,3,'B股',0.001,100,1000000);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (0.001,3,4,4,'基金不含ETF',0.001,100,1000000);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (0.001,3,5,5,'ETF',0.001,1000,1000000);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (0.01,2,6,6,'国债',0.01,10,10000);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (0.01,2,7,7,'其他债券',0.01,10,10000);
INSERT INTO `StockTypeInfo` (tickValue,precision,id,type,description,tick,minTradeNumber,maxTradeNumber) VALUES (0.01,2,8,8,'创业板',0.01,100,1000000);
CREATE TABLE Stock (stockid INTEGER PRIMARY KEY, marketid INTEGER, code VARCHAR(20), name VARCHAR(60), type INTEGER, valid INTEGER, startDate INTEGER, endDate INTEGER);
CREATE TABLE Market (marketid INTEGER PRIMARY KEY, market VARCHAR(10), name VARCHAR(60), description VARCHAR(100), code VARCHAR(20), lastDate INTEGER);
INSERT INTO `Market` (marketid,market,name,description,code,lastDate) VALUES (1,'SH','上海证劵交易所','上海市场','000001',19901219);
INSERT INTO `Market` (marketid,market,name,description,code,lastDate) VALUES (2,'SZ','深圳证劵交易所','深圳市场','399001',19901219);
CREATE TABLE "LastDate" (
id INTEGER NOT NULL,
date INTEGER,
PRIMARY KEY (id)
);
INSERT INTO `LastDate` (id,date) VALUES (1,19901219);
CREATE TABLE CodeRuleType (id INTEGER PRIMARY KEY, marketid INTEGER, codepre VARCHAR(20), type INTEGER, description VARCHAR(100));
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (1,1,'000',2,'上证指数');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (2,1,'600',1,'上证A股');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (3,1,'601',1,'上证A股');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (4,1,'900',3,'上证B股');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (5,2,'00',1,'深证A股');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (6,2,'20',3,'深证B股');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (7,2,'39',2,'深证指数');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (8,2,'150',4,'深证基金');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (9,2,'16',4,'深证基金');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (10,2,'18',4,'深证基金');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (11,2,'159',5,'深证ETF');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (12,1,'51',5,'上证ETF');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (13,1,'50',4,'上证基金');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (18,2,'300',8,'创业板');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (19,1,'603',1,'上证A股');
INSERT INTO `CodeRuleType` (id,marketid,codepre,type,description) VALUES (20,1,'519',4,'上证基金');
CREATE INDEX "ix_stkWeight_stockid" ON "stkWeight" (stockid);
CREATE INDEX "ix_stkWeight_date" ON "stkWeight" (date);
CREATE INDEX "ix_stkWeight" ON "stkWeight" (stockid, date);
COMMIT;

View File

@ -1,20 +0,0 @@

#log4cplus.rootLogger=TRACE, STDOUT
#log4cplus.appender.STDOUT=log4cplus::ConsoleAppender
#log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout
#log4cplus.appender.STDOUT.layout.ConversionPattern=%D{%H:%M:%S} [%t] %-5p - %m%n
log4cplus.logger.hikyuu=TRACE, STDOUT, LOGFILE
log4cplus.appender.STDOUT=log4cplus::ConsoleAppender
log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout
#log4cplus.appender.STDOUT.layout.ConversionPattern=%D{%H:%M:%S} [%t] %-5p - %m%n
log4cplus.appender.STDOUT.layout.ConversionPattern=%D{%H:%M:%S} %-5p - %m%n
log4cplus.appender.LOGFILE=log4cplus::RollingFileAppender
log4cplus.appender.LOGFILE.File=hikyuu.log
log4cplus.appender.LOGFILE.layout=log4cplus::PatternLayout
log4cplus.appender.LOGFILE.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S} [%t] %-5p - %m%n
log4cplus.appender.LOGFILE.filters.1=log4cplus::spi::LogLevelMatchFilter
log4cplus.appender.LOGFILE.filters.1.LogLevelToMatch=INFO
log4cplus.appender.LOGFILE.filters.1.AcceptOnMatch=true
log4cplus.appender.LOGFILE.filters.2=log4cplus::spi::DenyAllFilter

View File

@ -1,202 +0,0 @@
#!/usr/bin/python
# -*- coding: utf8 -*-
# cp936
#===============================================================================
# 作者fasiondog
# 历史120100220, Added by fasiondog
#===============================================================================
import os
import sys
import shutil
usr_dir = os.path.expanduser('~')
hku_dir = usr_dir + '/.hikyuu'
if not os.path.lexists(hku_dir):
os.mkdir(hku_dir)
def ask_question(question, default_anwser='N'):
flag = False
x = ''
while not flag:
x = input(question)
if x == '':
x = default_anwser
flag = True if (x=='' or x=='Y' or x=='y' or x=='N' or x=='n') else False
return False if (x=='' or x=='N' or x=='n') else True
data_config_file = hku_dir + '/data_dir.ini'
if os.path.exists(data_config_file):
os.remove(data_config_file);
default_dir = "c:\stock" if sys.platform == "win32" else usr_dir + "/stock"
data_directory = input("\n请输入股票数据存放路径(默认" + default_dir + "")
if data_directory == '':
data_directory = default_dir
with open(data_config_file, 'w', encoding = 'utf-8') as conf:
conf.writelines(['[data_dir]\n', 'data_dir=' + data_directory])
import_config = """
;db -
;sql - 使
[database]
db = {dir}/stock.db
sql = {dir}/createdb.sql
;
;shsz分别指定上证
[weight]
sh = {dir}/weight/shase/weight
sz = {dir}/weight/sznse/weight
;sh = D:\LON\QLDATA\history\SHASE\weight
;sz = D:\LON\QLDATA\history\SZNSE\weight
;K线数据源 , dzh tdx
;
[from]
1 = tdx, {tdx}
;2 = dzh, d:\DZH5
;K线导入的目标文件
;allK线导入
;all选择为trueK线数据使
;all默认为falseA股B股
[dest]
;all = True
sh_day = {dir}/sh_day.h5
sz_day = {dir}/sz_day.h5
sh_5min = {dir}/sh_5min.h5
sz_5min = {dir}/sz_5min.h5
sh_1min = {dir}/sh_1min.h5
sz_1min = {dir}/sz_1min.h5
"""
hikyuu_config = """
[hikyuu]
tmpdir = {dir}/tmp
logger = {dir}/logger.properties
[block]
type = qianlong
dir = {dir}/block
= zsbk.ini
= hybk.ini
= dybk.ini
= gnbk.ini
self = self.ini
[preload]
day = 1
week = 0
month = 0
quarter = 0
halfyear = 0
year = 0
[baseinfo]
type = sqlite3
db = {dir}/stock.db
[kdata]
;type = tdx
;dir = D:\\TdxW_HuaTai\\vipdoc
type = hdf5
sh_day = {dir}/sh_day.h5
sh_min = {dir}/sh_1min.h5
sh_min5 = {dir}/sh_5min.h5
sz_day = {dir}/sz_day.h5
sz_min = {dir}/sz_1min.h5
sz_min5 = {dir}/sz_5min.h5
"""
tdx_default_dir = "c:\TdxW_HuaTai" if sys.platform == "win32" else usr_dir + "/.wine/driver/c/Tdx_HuaTai"
tdx_input_str = "请输入通达信安装路径(默认从" + tdx_default_dir + ""
if not os.path.lexists(data_directory):
shutil.copytree('config', data_directory)
os.remove(data_directory + '/__init__.py')
if sys.platform == 'win32':
filename = data_directory + '/hikyuu_win.ini'
else:
filename = data_directory + '/hikyuu_linux.ini'
with open(filename, 'w', encoding = 'utf-8') as f:
f.write(hikyuu_config.format(dir=data_directory))
tdx_dir = input(tdx_input_str)
if tdx_dir == '':
tdx_dir = tdx_default_dir
with open(data_directory + '/importdata.ini', 'w', encoding = 'utf-8') as f:
f.write(import_config.format(dir=data_directory, tdx=tdx_dir))
os.mkdir(data_directory + '/tmp')
else:
if os.path.lexists(data_directory + '/block'):
pass
x = ask_question("block目录已存在是否覆盖(Y/[N])")
if x:
shutil.rmtree(data_directory + '/block')
shutil.copytree('config/block', data_directory + '/block')
os.remove(data_directory + '/block/__init__.py')
else:
shutil.copytree('config/block', data_directory + '/block')
os.remove(data_directory + '/block/__init__.py')
if os.path.exists(data_directory + '/logger.properties'):
pass
x = ask_question("logger.properties文件已存在是否覆盖(Y/[N])")
if x:
os.remove(data_directory + '/logger.properties')
shutil.copy('config/logger.properties', data_directory + '/logger.properties')
else:
shutil.copy('config/logger.properties', data_directory + '/logger.properties')
if os.path.exists(data_directory + '/importdata.ini'):
x = ask_question("importdata.ini文件已存在是否覆盖(Y/[N])")
if x:
os.remove(data_directory + '/importdata.ini')
tdx_dir = input(tdx_input_str)
if tdx_dir == '':
tdx_dir = tdx_default_dir
with open(data_directory + '/importdata.ini', 'w', encoding = 'utf-8') as f:
f.write(import_config.format(dir=data_directory, tdx=tdx_dir))
else:
tdx_dir = input(tdx_input_str)
if tdx_dir == '':
tdx_dir = tdx_default_dir
with open(data_directory + '/importdata.ini', 'w', encoding = 'utf-8') as f:
f.write(import_config.format(dir=data_directory, tdx=tdx_dir))
if os.path.exists(data_directory + '/createdb.sql'):
os.remove(data_directory + '/createdb.sql')
shutil.copy('config/createdb.sql', data_directory + '/createdb.sql')
if sys.platform == 'win32':
hikyuu_ini = '/hikyuu_win.ini'
else:
hikyuu_ini = '/hikyuu_linux.ini'
filename = data_directory + hikyuu_ini
if os.path.exists(data_directory + hikyuu_ini):
x = ask_question(hikyuu_ini[1:] + "文件已存在是否覆盖?(Y/[N])")
if x:
os.remove(filename)
with open(data_directory + hikyuu_ini, 'w', encoding = 'utf-8') as f:
f.write(hikyuu_config.format(dir=data_directory))
else:
with open(data_directory + hikyuu_ini, 'w', encoding = 'utf-8') as f:
f.write(hikyuu_config.format(dir=data_directory))
if not os.path.lexists(data_directory + '/tmp'):
os.mkdir(data_directory + '/tmp')
#print(import_config.format(dir=data_directory))