conf = default_config()
deep_update(user_config(), conf)
deep_update(project_config(), conf)
三种不一样级别的配置,第一个是默认配置,第二个是用户级配置,第三个是工程级配置(这种方法看起来和php的配置逻辑类似)
第四个是命令行若存在config_path选项,则使用config_path提供的配置
get_trading_calendar, 搞清楚这儿怎样获得的交易日:经过读取文件:trading_dates.bcolz获取到:
经过:
self._dates = pd.Index(pd.Timestamp(str(d)) for d in bcolz.open(f, 'r')),
其中:f = 'C:\\Users\\lu/.rqalpha\\bundle\\trading_dates.bcolz'
获取到的数据是已经去除了周六和周日,国家公布的法定节假日的日期集合
取得的数据相似以下:
DividendStore:看起来是除权信息
InstrumentStore看起来是股票信息,形如:
经过:
user_strategy = Strategy(env.event_bus, scope, ucontext, should_run_init)
env.user_strategy = user_strategy
user_strategy.init()
将代码读入并运行php
executor.py是一个执行器ide
executor.run():spa
这儿经过simulation_event_source.events():命令行
在simulation_event_source.py中:
code
yield Event(EVENT.BEFORE_TRADING, calendar_dt=dt_before_trading, trading_dt=dt_before_trading)这儿连续几个yield须要深度理解,明显尚未理解好