@Channelchan
2018-01-06T15:22:19.000000Z
字数 584
阅读 125116
进入cmd
rqalpha update_bundle
## 导入api,初始化与执行引擎。
import rqalpha
from rqalpha.api import *
# context作为全局变量做传递
def init(context):
context.message = 'hello'
#用来写开始的时候做什么
def handle_bar(context, bar_dict):
print (context.message)
#用来写每次循环要作什么
## config设置
config = {
"base": {
"start_date": "2017-04-21",
"end_date": "2017-05-01",
"accounts": {'stock':1000000},
"stock_starting_cash": 1000000,
"benchmark": "000300.XSHG",
},
"extra": {
"log_level": "error",
},
"mod": {
"sys_analyser": {
"enabled": False,
"plot": False
}
}
}
# 您可以指定您要传递的参数
rqalpha.run_func(init=init, handle_bar=handle_bar, config=config)
hello
hello
hello
hello
hello
hello
{}