Skip to content

Commit fe689b0

Browse files
committed
1.补全修改到py35
2.修复安装过程中的提示错误
1 parent 96530a3 commit fe689b0

36 files changed

+161
-187
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ wiki文档_
135135
# 绘制净值曲线
136136
plotting.plot_curves([curve.networth])
137137
# 打印统计信息
138-
print finance.summary_stats(curve, 252*4*60)
138+
print( finance.summary_stats(curve, 252*4*60))
139139
140140
141141
策略结果

demo/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
log.info("启动ipython..")
2222
shell = subprocess.call('ipython --config=%s' % shell_path, shell=True)
2323
###notebook = subprocess.call('jupyter notebook --config=shell.py', shell=True)
24-
###print mainwindow.pid
24+
###prin(t mainwindow.pid)
2525

2626
raw_input("Any key to quit quantdigger.")
2727
subprocess.Popen.kill(mainwindow)

demo/manytomany.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def on_symbol(self, ctx):
5858
def on_exit(self, ctx):
5959
return
6060

61-
def manytomany():
61+
if __name__ == '__main__':
6262
from quantdigger.digger import finance
6363

6464
set_symbols(['BB.SHFE-1.Minute'])

demo/mongotest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def on_bar(self, ctx):
7272
def on_exit(self, ctx):
7373
return
7474

75-
def mongotest():
75+
if __name__ == '__main__':
7676
import timeit
7777
ConfigUtil.set({
7878
'source': 'mongodb',

demo/mplot_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import matplotlib
33
import matplotlib.pyplot as plt
44
import pandas as pd
5-
# matplotlib.use('TkAgg')
5+
matplotlib.use('TkAgg')
66

77
from quantdigger.widgets.mplotwidgets import widgets
88
from quantdigger.widgets.mplotwidgets.mplots import Candles

demo/plot_strategy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def on_init(self, ctx):
3333

3434
def on_bar(self, ctx):
3535
ctx.dt.update(ctx.datetime)
36-
#print ctx.dt[1].isocalendar()[1], ctx.dt[0].isocalendar()[1]
36+
#print( ctx.dt[1].isocalendar()[1], ctx.dt[0].isocalendar()[1])
3737
if ctx.dt[1].month != ctx.dt[0].month:
3838
ctx.month_price.update(ctx.close)
3939
if ctx.curbar > 20:
@@ -81,7 +81,7 @@ def on_exit(self, ctx):
8181
return
8282

8383

84-
def plot_strategy():
84+
if __name__ == '__main__':
8585
import timeit
8686
start = timeit.default_timer()
8787
#set_symbols(['BB.SHFE-1.Minute'])

demo/profile_strategy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def on_exit(self, ctx):
4747
return
4848

4949

50-
def profile_strategy():
50+
if __name__ == '__main__':
5151
import timeit
5252
from quantdigger.digger.analyze import AnalyzeFrame
5353
import matplotlib.pyplot as plt

demo/stg_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def on_exit(self, ctx):
4646
pass
4747

4848

49-
if __init__ == "__main__":
49+
if __name__ == '__main__':
5050
import timeit
5151
start = timeit.default_timer()
5252
#ConfigUtil.set(source='tushare')

demo/stock_search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ def on_bar(self, ctx):
3131
for symbol in self.to_sell:
3232
if ctx.pos('long', symbol) > 0:
3333
ctx.sell(ctx[symbol].close, 1, symbol)
34-
#print "sell:", symbol
34+
#print( "sell:", symbol)
3535

3636
for symbol in self.candicates:
3737
if ctx.pos('long', symbol) == 0:
3838
ctx.buy(ctx[symbol].close, 1, symbol)
39-
#print "buy:", symbol
39+
#print( "buy:", symbol)
4040

4141

4242
self.candicates = []
@@ -49,7 +49,7 @@ def on_exit(self, ctx):
4949

5050

5151

52-
def stock_search():
52+
if __name__ == '__main__':
5353
#
5454
set_symbols(['*.SH'])
5555
algo = DemoStrategy('A1')

demo/tools/sql.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,18 @@ def sql2csv(db, cursor):
8686
start = timeit.default_timer()
8787
read_csv(os.getcwd())
8888
stop = timeit.default_timer()
89-
print (stop - start ) * 1000
90-
print "---------"
89+
print( (stop - start ) * 1000)
90+
print( "---------")
9191
db.commit()
9292

9393
start = timeit.default_timer()
9494
open = close = high = low = []
9595
for row in c.execute('SELECT id, datetime, open FROM AA_SHFE'):
96-
print row
97-
print get_tables(c)
96+
print( row)
97+
print( get_tables(c))
9898

9999
stop = timeit.default_timer()
100-
print (stop - start ) * 1000
100+
print( (stop - start ) * 1000)
101101

102102
get_tables(c)
103103
db.commit()

0 commit comments

Comments
 (0)