forked from lvhui/stock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
1,784 additions
and
1,770 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[codestyle] | ||
indentation = True | ||
|
||
[main] | ||
version = '0.1.0' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[encoding] | ||
text_encoding = utf-8 | ||
|
||
[main] | ||
version = '0.1.0' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#目录结构 | ||
|
||
... auto 自动化交易 | ||
... crawler 爬虫目录 | ||
.... data 获取股票数据 | ||
.... lib 自动化类 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.