def optimizeOptWinHighNav(ppid, configIni, us, period, histNavRangeList, group, className, path): logger = logging.getLogger() if not (os.getpid() != ppid and os.getppid() == ppid): logger.info('父进程 不执行 {}'.format(ppid)) return config = ConfigParser() config.read(configIni) nav = Nav(config, us, group, className, path) nav.run() wr = Winroll(nav) opt = Optimize(wr) opt.optWinHighNav([period], histNavRangeList)
def initWinrollDf(ppid, configIni, us, periodList, group, className, path): logger = logging.getLogger() if not (os.getpid() != ppid and os.getppid() == ppid): logger.info('父进程 不执行 {}'.format(ppid)) return config = ConfigParser() config.read(configIni) nav = Nav(config, us, group, className, path) nav.run() wr = Winroll(nav) for period in periodList: logger.info('加载 winroll {} {}'.format(us, period)) wr.loadOptsvNavByWin(period)
def initnav(ppid, configIni, us, group, className, path): logger = logging.getLogger() if not (os.getpid() != ppid and os.getppid() == ppid): logger.info('父进程 不执行 {}'.format(ppid)) return config = ConfigParser() config.read(configIni) try: nav = Nav(config, us, group, className, path) # 生成净值和数据汇总 nav.run() except Exception: traceback.print_exc() return us
def test_nav(config): """ 生成 originData 的本地缓存 :param : :return: """ from holygrail.nav import Nav print('生成测试用的 originData,us: rb') path = config.get('单元测试', 'path') nav = Nav(config, 'rb', '布林带密集步长', 'SvtBollChannelStrategy', path) # 生成净值和数据汇总 nav.run()
def test_drawPotentiometric(cnofig): import os import logging.config from configparser import ConfigParser import importlib import holygrail from holygrail import optHisNavHihestWinLowest importlib.reload(holygrail.winroll) importlib.reload(holygrail.optimize) from holygrail.optimize import Optimize from holygrail.winroll import Winroll from holygrail.nav import Nav # logging.config.fileConfig('/Users/lamter/workspace/SlaveO/holygrail/tmp/logging.ini') configIni = '/Users/lamter/workspace/SlaveO/holygrail/tmp/boll_opt.ini' config = ConfigParser() config.read(configIni) path = config.get('优化', 'path') group, className = '布林带密集步长', 'SvtBollChannelStrategy' periodList = ['{}BM'.format(i) for i in range(1, 13)] histNavRangeList = list(range(10, 200, 1)) us = 'rb' nav = Nav(config, us, group, className, path) nav.run() wr = Winroll(nav) opt = Optimize(wr) # 运行优化 # opt.optHisNavHihestWinLowest(periodList, histNavRangeList) # 绘图生成净值等势图 opt.draw_3dpotentiometric_anaHisNavHihestWinLowest()
def nav(config): from holygrail.nav import Nav path = config.get('单元测试', 'path') nav = Nav(None, 'rb', '布林带密集步长', 'SvtBollChannelStrategy', path) nav.run() return nav