|
@@ -14,16 +14,6 @@ import os
|
|
# import multiprocessing
|
|
# import multiprocessing
|
|
import matplotlib
|
|
import matplotlib
|
|
|
|
|
|
-cpu_count = os.cpu_count()
|
|
|
|
-os_name = os.name
|
|
|
|
-if os_name == 'posix':
|
|
|
|
- path = '/Users/daniel/Documents/策略穷举2.csv'
|
|
|
|
-else:
|
|
|
|
- path = 'D:\\BackTrader\\策略穷举0105。csv'
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
class MyPandasData(PandasData):
|
|
class MyPandasData(PandasData):
|
|
lines = ('change_pct', 'net_amount_main', 'net_pct_main', 'net_amount_xl', 'net_pct_xl', 'net_amount_l', 'net_pct_l'
|
|
lines = ('change_pct', 'net_amount_main', 'net_pct_main', 'net_amount_xl', 'net_pct_xl', 'net_amount_l', 'net_pct_l'
|
|
, 'net_amount_m', 'net_pct_m', 'net_amount_s', 'net_pct_s',)
|
|
, 'net_amount_m', 'net_pct_m', 'net_amount_s', 'net_pct_s',)
|
|
@@ -205,7 +195,12 @@ if __name__ == '__main__':
|
|
|
|
|
|
# stocks = pd.read_sql_query(
|
|
# stocks = pd.read_sql_query(
|
|
# 'select value from MA5_1d', engine_hlfx)
|
|
# 'select value from MA5_1d', engine_hlfx)
|
|
-
|
|
|
|
|
|
+ cpu_count = os.cpu_count()
|
|
|
|
+ os_name = os.name
|
|
|
|
+ if os_name == 'posix':
|
|
|
|
+ path = '/Users/daniel/Documents/'
|
|
|
|
+ else:
|
|
|
|
+ path = 'D:\\BackTrader\\'
|
|
fre = '1d'
|
|
fre = '1d'
|
|
db = pymysql.connect(host='localhost',
|
|
db = pymysql.connect(host='localhost',
|
|
user='root',
|
|
user='root',
|
|
@@ -267,4 +262,4 @@ if __name__ == '__main__':
|
|
print('每轮耗时:', endtime-stattime)
|
|
print('每轮耗时:', endtime-stattime)
|
|
edtime = dt.now()
|
|
edtime = dt.now()
|
|
print('总耗时:', edtime - sttime)
|
|
print('总耗时:', edtime - sttime)
|
|
- df.to_csv(path, index=True)
|
|
|
|
|
|
+ df.to_csv(path+dt.now().strftime('%Y-%m-%d')+'.csv', index=True)
|