def __save_strategy_files(self):
file_name = '{}backtest_{}.py'.format(
self.dirs, self.account.account_cookie)
with open(sys.argv[0], 'rb') as p:
data = p.read()
collection = self.setting.client.quantaxis.strategy
collection.insert({'cookie': self.account.account_cookie, 'name': self.strategy_name,
'topic': self.topic_name, 'version': self.stratey_version, 'user': self.user, 'datetime': datetime.datetime.now(),
'content': data.decode('utf-8'),
'dirs': self.dirs,
'absoultpath': self.absoult_path})
with open(file_name, 'wb') as f:
f.write(data)
评论列表
文章目录