1.基本使用 Bactrader系统提供了观察者对象Observer,来记录和统计回测运行过程中各种状态,并以绘图的形式展现出来。在回测过程,并没有发现存在观察者,是因为系统默认自动加入了三个观察者,即Broker、Trades、BuySell。 在程序使用cerebro.plot()画图时显现。 # cerebro = bt.Cerebro(stdstats=True) stdstats默认为True cerebro = bt.Cerebro() cerebro.addobserver(bt.observers.Broker) cerebro.addobserver(bt<