在自己的编辑器写大qmt策略






#coding:gbkdef load_strategy(path):import tokenize# 从文件头读取 # coding: xxx 声明with open(path, 'rb') as f:encoding = tokenize.detect_encoding(f.readline)[0]with open(path, encoding=encoding) as f:code = f.read()exec(compile(code, path, 'exec'), globals())returnload_strategy(r'..\python\mylib\策略2.py')
#coding:utf-8def init(C):print('init')returndef after_init(C):print('after_init')returndef handlebar(C):if not C.is_last_bar():returnprint('handlebar: {}'.format(C.barpos))return
夜雨聆风