Skip to content

Commit

Permalink
修改目录结构
Browse files Browse the repository at this point in the history
  • Loading branch information
daveqin committed Jun 30, 2019
1 parent 263fe61 commit 0182ef7
Show file tree
Hide file tree
Showing 95 changed files with 1,784 additions and 1,770 deletions.
6 changes: 6 additions & 0 deletions auto_stock/.spyproject/codestyle.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codestyle]
indentation = True

[main]
version = '0.1.0'

6 changes: 6 additions & 0 deletions auto_stock/.spyproject/encoding.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[encoding]
text_encoding = utf-8

[main]
version = '0.1.0'

7 changes: 7 additions & 0 deletions auto_stock/.spyproject/vcs.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[vcs]
use_version_control = False
version_control_system =

[main]
version = '0.1.0'

10 changes: 10 additions & 0 deletions auto_stock/.spyproject/workspace.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[workspace]
save_data_on_exit = True
restore_data_on_startup = True
save_history = True
save_non_project_files = False

[main]
version = '0.1.0'
recent_files = [u'C:\\Users\\Administrator\\.spyder\\temp.py', u'F:\\git\\stock\\auto_stock\\auto.py', u'F:\\git\\stock\\auto_stock\\server.py', u'F:\\git\\stock\\auto_stock\\main.py', u'F:\\git\\stock\\auto_stock\\gui.py', u'F:\\git\\stock\\auto_stock\\auto\\main.py', u'F:\\git\\stock\\auto_stock\\common\\DBMange.py', u'F:\\git\\stock\\auto_stock\\common\\Software.py', u'F:\\git\\stock\\auto_stock\\common\\VK_CODE.py']

6 changes: 6 additions & 0 deletions auto_stock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#目录结构

... auto 自动化交易
... crawler 爬虫目录
.... data 获取股票数据
.... lib 自动化类
102 changes: 51 additions & 51 deletions auto.py → auto_stock/auto.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 18 13:05:36 2018
@author: daveqing
@qq : 1029329095
"""

from lib import Winauto


#软件启动
class Auto(object):

#软件初始化
def __init__(self):
self.Winauto = Winauto();

#判断软件是否启动成功
def IsWindow(self):
if self.Winauto.IsWindow():
return 1
else:
return 0

#软件启动
def startApp(self,filePath,var):
self.Winauto.appStart(filePath,var)

#购买
def buy(self,stock,price,num):
self.Winauto.Buy(stock,price,num)

#出售
def sell(self,stock,price,num):
self.Winauto.Sell(stock,price,num)

#查看所有资产
def getAllInfo(self):
return self.Winauto.getAllAsset();

#窗口置顶
def topWindow(self):
self.Winauto.topWindow()

#查询目前持仓





# -*- coding: utf-8 -*-
"""
Created on Mon Jun 18 13:05:36 2018
@author: daveqing
@qq : 1029329095
"""

from lib import Winauto


#软件启动
class Auto(object):

#软件初始化
def __init__(self):
self.Winauto = Winauto();

#判断软件是否启动成功
def IsWindow(self):
if self.Winauto.IsWindow():
return 1
else:
return 0

#软件启动
def startApp(self,filePath,var):
self.Winauto.appStart(filePath,var)

#购买
def buy(self,stock,price,num):
self.Winauto.Buy(stock,price,num)

#出售
def sell(self,stock,price,num):
self.Winauto.Sell(stock,price,num)

#查看所有资产
def getAllInfo(self):
return self.Winauto.getAllAsset();

#窗口置顶
def topWindow(self):
self.Winauto.topWindow()

#查询目前持仓






Binary file renamed auto.pyc → auto_stock/auto.pyc
Binary file not shown.
66 changes: 33 additions & 33 deletions auto.spec → auto_stock/auto.spec
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# -*- mode: python -*-

block_cipher = None


a = Analysis(['auto.py'],
pathex=['E:\\dev\\python\\python-dem\\python-dem\\stock'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='auto',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='auto')
# -*- mode: python -*-

block_cipher = None


a = Analysis(['auto.py'],
pathex=['E:\\dev\\python\\python-dem\\python-dem\\stock'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='auto',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='auto')
82 changes: 41 additions & 41 deletions auto/main.py → auto_stock/auto/main.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# -*- coding: utf-8 -*-
import sys
sys.path.append('../')
from common import Software
from common import DBMange
import time


class Winauto(object):

def __init__(self):
self.flush = Software(u'同花顺(v8.60.83) - A股技术分析')
self.flush.topWindow()
self.db = DBMange()

def seeK(self,stock):
self.flush.keyStr(stock)
self.flush.Key_event('enter')

def getData(self,stype):
if stype==1:
sql = "SELECT hy_zystock FROM hy \
WHERE newtime = '%s' " % ('2018-08-13')
if stype==2:
sql = "SELECT stkCode FROM stocklhrank \
WHERE newtime = '%s' " % ('2018-08-13')
data = self.db.select(sql)
stock = []
for row in data:
fname = row[0]
# 打印结果
stock.append(fname)
return stock


auto = Winauto()
stockList =auto.getData(1)
for i in range(len(stockList)):
auto.seeK(stockList[i][0:6])
#print stockList[i][0:6]
time.sleep(5)
# -*- coding: utf-8 -*-
import sys
sys.path.append('../')
from common import Software
from common import DBMange
import time


class Winauto(object):

def __init__(self):
self.flush = Software(u'同花顺(v8.60.83) - A股技术分析')
self.flush.topWindow()
self.db = DBMange()

def seeK(self,stock):
self.flush.keyStr(stock)
self.flush.Key_event('enter')

def getData(self,stype):
if stype==1:
sql = "SELECT hy_zystock FROM hy \
WHERE newtime = '%s' " % ('2018-08-13')
if stype==2:
sql = "SELECT stkCode FROM stocklhrank \
WHERE newtime = '%s' " % ('2018-08-13')
data = self.db.select(sql)
stock = []
for row in data:
fname = row[0]
# 打印结果
stock.append(fname)
return stock


auto = Winauto()
stockList =auto.getData(1)
for i in range(len(stockList)):
auto.seeK(stockList[i][0:6])
#print stockList[i][0:6]
time.sleep(5)
34 changes: 17 additions & 17 deletions common/DBMange.py → auto_stock/common/DBMange.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# -*- coding: utf-8 -*-

# -*- coding: utf-8 -*-
import pymysql
import time

class DBMange(object):

def __init__(self):

self.db = pymysql.connect("localhost","root","root","stock",charset="utf8")
self.cursor = self.db.cursor()

def select(self,sql):
self.cursor.execute(sql)
# 获取所有记录列表
self.results = self.cursor.fetchall()
# -*- coding: utf-8 -*-

# -*- coding: utf-8 -*-
import pymysql
import time

class DBMange(object):

def __init__(self):

self.db = pymysql.connect("localhost","root","root","stock",charset="utf8")
self.cursor = self.db.cursor()

def select(self,sql):
self.cursor.execute(sql)
# 获取所有记录列表
self.results = self.cursor.fetchall()
return self.results
File renamed without changes.
Loading

0 comments on commit 0182ef7

Please sign in to comment.