backtrader回测系统

backtrader
量化交易
Author

王一刀

Published

December 6, 2021

import datetime
import backtrader as bt
import pandas as pd

class TestStrategy(bt.Strategy):
    params = (
        ('maperiod', 15),
    )

    def log(self, txt, dt=None):
        dt = dt or self.datas[0].datetime.date(0)
        print('%s, %s' % (dt.isoformat(), txt))
    def __init__(self):
        self.dataclose = self.datas[0].close
        print('buflen %d' % self.dataclose.buflen())
        self.order = None
        self.buyprice = None
        self.buycomm = None

        # Add a MovingAverageSimple indicator
        self.sma = bt.indicators.SimpleMovingAverage(
            self.datas[0], period=self.params.maperiod)
        
        # Indicators for the plotting show
        bt.indicators.ExponentialMovingAverage(self.datas[0], period=25)
        bt.indicators.WeightedMovingAverage(self.datas[0], period=25,
                                            subplot=True)
        bt.indicators.StochasticSlow(self.datas[0])
        bt.indicators.MACDHisto(self.datas[0])
        rsi = bt.indicators.RSI(self.datas[0])
        bt.indicators.SmoothedMovingAverage(rsi, period=10)
        bt.indicators.ATR(self.datas[0], plot=False)

    def notify_order(self, order):
        if order.status in [order.Submitted, order.Accepted]:
            return
        if order.status in [order.Completed]:
            if order.isbuy():
                self.log('BUY EXECUTED, Price: %.2f, Cost: %.2f, Comm %.2f' %
                        (order.executed.price,
                        order.executed.value,
                        order.executed.comm))
                self.buyprice = order.executed.price
                self.buycomm = order.executed.comm
            elif order.issell():
                self.log('SELL EXECUTED, Price: %.2f, Cost: %.2f, Comm %.2f' %
                         (order.executed.price,
                          order.executed.value,
                          order.executed.comm))
            self.bar_executed = len(self)
        elif order.status in [order.Canceled, order.Margin, order.Rejected]:
            self.log('Order Canceled/Margin/Rejected')
        self.order = None

    def notify_trade(self, trade):
        if not trade.isclosed:
            return

        self.log('OPERATION PROFIT, GROSS %.2f, NET %.2f' %
                 (trade.pnl, trade.pnlcomm))

    def next(self):
        self.log('Close, %.2f' % self.dataclose[0])
        if self.order:
            return
        if not self.position:
            if self.dataclose[0] > self.sma[0]:
                self.log('BUY CREATE, %.2f' % self.dataclose[0])
                print(self.buy())
        else:
            if self.dataclose[0] < self.sma[0]:
                self.log('SELL CREATE, %.2f' % self.dataclose[0])
                self.order = self.sell()


cerebro = bt.Cerebro()

cerebro.addstrategy(TestStrategy)

data = bt.feeds.YahooFinanceCSVData(
        dataname="datas/orcl-1995-2014.txt",
        # Do not pass values before this date
        fromdate=datetime.datetime(2000, 1, 1),
        # Do not pass values after this date
        todate=datetime.datetime(2000, 12, 31),
        reverse=False)

# print(data)

cerebro.adddata(data)

cerebro.broker.setcash(100000.0)
cerebro.addsizer(bt.sizers.FixedSize, stake=10)
cerebro.broker.setcommission(commission=0.001)

print('组合初始值: %.2f' % cerebro.broker.getvalue())

result=cerebro.run()

print('组合终结值: %.2f' % cerebro.broker.getvalue())
cerebro.plot()
组合初始值: 100000.00
buflen 252
2000-02-18, Close, 26.05
2000-02-22, Close, 26.38
2000-02-22, BUY CREATE, 26.38
Ref: 81
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730172.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-02-23, BUY EXECUTED, Price: 26.77, Cost: 267.70, Comm 0.27
2000-02-23, Close, 28.05
2000-02-24, Close, 27.55
2000-02-25, Close, 31.41
2000-02-28, Close, 30.52
2000-02-29, Close, 33.02
2000-03-01, Close, 31.80
2000-03-02, Close, 30.47
2000-03-03, Close, 33.36
2000-03-06, Close, 33.69
2000-03-07, Close, 33.33
2000-03-08, Close, 36.97
2000-03-09, Close, 37.36
2000-03-10, Close, 36.30
2000-03-13, Close, 35.02
2000-03-14, Close, 34.25
2000-03-15, Close, 34.97
2000-03-16, Close, 36.44
2000-03-17, Close, 35.50
2000-03-20, Close, 34.75
2000-03-21, Close, 35.89
2000-03-22, Close, 37.39
2000-03-23, Close, 38.64
2000-03-24, Close, 38.69
2000-03-27, Close, 39.33
2000-03-28, Close, 38.50
2000-03-29, Close, 36.69
2000-03-30, Close, 34.88
2000-03-30, SELL CREATE, 34.88
2000-03-31, SELL EXECUTED, Price: 35.66, Cost: 267.70, Comm 0.36
2000-03-31, OPERATION PROFIT, GROSS 88.90, NET 88.28
2000-03-31, Close, 34.72
2000-04-03, Close, 34.19
2000-04-04, Close, 33.77
2000-04-05, Close, 34.80
2000-04-06, Close, 36.55
2000-04-06, BUY CREATE, 36.55
Ref: 83
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730216.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-04-07, BUY EXECUTED, Price: 37.22, Cost: 372.20, Comm 0.37
2000-04-07, Close, 38.75
2000-04-10, Close, 36.69
2000-04-11, Close, 34.41
2000-04-11, SELL CREATE, 34.41
2000-04-12, SELL EXECUTED, Price: 34.66, Cost: 372.20, Comm 0.35
2000-04-12, OPERATION PROFIT, GROSS -25.60, NET -26.32
2000-04-12, Close, 32.52
2000-04-13, Close, 31.99
2000-04-14, Close, 27.80
2000-04-17, Close, 33.27
2000-04-18, Close, 35.11
2000-04-18, BUY CREATE, 35.11
Ref: 85
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730228.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-04-19, BUY EXECUTED, Price: 34.97, Cost: 349.70, Comm 0.35
2000-04-19, Close, 33.16
2000-04-19, SELL CREATE, 33.16
2000-04-20, SELL EXECUTED, Price: 32.83, Cost: 349.70, Comm 0.33
2000-04-20, OPERATION PROFIT, GROSS -21.40, NET -22.08
2000-04-20, Close, 31.49
2000-04-24, Close, 32.22
2000-04-25, Close, 33.61
2000-04-26, Close, 32.11
2000-04-27, Close, 34.38
2000-04-27, BUY CREATE, 34.38
Ref: 87
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730237.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-04-28, BUY EXECUTED, Price: 34.91, Cost: 349.10, Comm 0.35
2000-04-28, Close, 35.55
2000-05-01, Close, 35.44
2000-05-02, Close, 34.61
2000-05-03, Close, 33.72
2000-05-04, Close, 33.02
2000-05-04, SELL CREATE, 33.02
2000-05-05, SELL EXECUTED, Price: 32.91, Cost: 349.10, Comm 0.33
2000-05-05, OPERATION PROFIT, GROSS -20.00, NET -20.68
2000-05-05, Close, 34.16
2000-05-05, BUY CREATE, 34.16
Ref: 89
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730245.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-05-08, BUY EXECUTED, Price: 33.49, Cost: 334.90, Comm 0.33
2000-05-08, Close, 32.16
2000-05-08, SELL CREATE, 32.16
2000-05-09, SELL EXECUTED, Price: 32.77, Cost: 334.90, Comm 0.33
2000-05-09, OPERATION PROFIT, GROSS -7.20, NET -7.86
2000-05-09, Close, 32.02
2000-05-10, Close, 30.08
2000-05-11, Close, 32.19
2000-05-12, Close, 32.99
2000-05-15, Close, 34.25
2000-05-15, BUY CREATE, 34.25
Ref: 91
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730255.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-05-16, BUY EXECUTED, Price: 34.52, Cost: 345.20, Comm 0.35
2000-05-16, Close, 35.22
2000-05-17, Close, 34.77
2000-05-18, Close, 32.49
2000-05-18, SELL CREATE, 32.49
2000-05-19, SELL EXECUTED, Price: 32.02, Cost: 345.20, Comm 0.32
2000-05-19, OPERATION PROFIT, GROSS -25.00, NET -25.67
2000-05-19, Close, 31.16
2000-05-22, Close, 30.16
2000-05-23, Close, 27.85
2000-05-24, Close, 28.57
2000-05-25, Close, 29.55
2000-05-26, Close, 29.80
2000-05-30, Close, 32.99
2000-05-30, BUY CREATE, 32.99
Ref: 93
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730270.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-05-31, BUY EXECUTED, Price: 32.58, Cost: 325.80, Comm 0.33
2000-05-31, Close, 31.97
2000-06-01, Close, 34.63
2000-06-02, Close, 35.66
2000-06-05, Close, 36.00
2000-06-06, Close, 34.27
2000-06-07, Close, 35.58
2000-06-08, Close, 36.64
2000-06-09, Close, 36.77
2000-06-12, Close, 35.83
2000-06-13, Close, 36.33
2000-06-14, Close, 35.13
2000-06-15, Close, 36.69
2000-06-16, Close, 36.41
2000-06-19, Close, 38.25
2000-06-20, Close, 38.27
2000-06-21, Close, 38.33
2000-06-22, Close, 36.25
2000-06-22, SELL CREATE, 36.25
2000-06-23, SELL EXECUTED, Price: 35.94, Cost: 325.80, Comm 0.36
2000-06-23, OPERATION PROFIT, GROSS 33.60, NET 32.91
2000-06-23, Close, 35.36
2000-06-26, Close, 36.77
2000-06-26, BUY CREATE, 36.77
Ref: 95
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730297.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-06-27, BUY EXECUTED, Price: 36.64, Cost: 366.40, Comm 0.37
2000-06-27, Close, 36.58
2000-06-27, SELL CREATE, 36.58
2000-06-28, SELL EXECUTED, Price: 36.50, Cost: 366.40, Comm 0.36
2000-06-28, OPERATION PROFIT, GROSS -1.40, NET -2.13
2000-06-28, Close, 36.89
2000-06-28, BUY CREATE, 36.89
Ref: 97
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730299.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-06-29, BUY EXECUTED, Price: 36.50, Cost: 365.00, Comm 0.36
2000-06-29, Close, 35.97
2000-06-29, SELL CREATE, 35.97
2000-06-30, SELL EXECUTED, Price: 35.75, Cost: 365.00, Comm 0.36
2000-06-30, OPERATION PROFIT, GROSS -7.50, NET -8.22
2000-06-30, Close, 37.39
2000-06-30, BUY CREATE, 37.39
Ref: 99
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730301.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-07-03, BUY EXECUTED, Price: 36.08, Cost: 360.80, Comm 0.36
2000-07-03, Close, 35.66
2000-07-03, SELL CREATE, 35.66
2000-07-05, SELL EXECUTED, Price: 34.16, Cost: 360.80, Comm 0.34
2000-07-05, OPERATION PROFIT, GROSS -19.20, NET -19.90
2000-07-05, Close, 32.16
2000-07-06, Close, 33.63
2000-07-07, Close, 33.75
2000-07-10, Close, 32.97
2000-07-11, Close, 32.16
2000-07-12, Close, 33.22
2000-07-13, Close, 33.69
2000-07-14, Close, 33.86
2000-07-17, Close, 33.86
2000-07-18, Close, 32.99
2000-07-19, Close, 32.80
2000-07-20, Close, 34.75
2000-07-20, BUY CREATE, 34.75
Ref: 101
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730321.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-07-21, BUY EXECUTED, Price: 34.44, Cost: 344.40, Comm 0.34
2000-07-21, Close, 33.55
2000-07-21, SELL CREATE, 33.55
2000-07-24, SELL EXECUTED, Price: 34.30, Cost: 344.40, Comm 0.34
2000-07-24, OPERATION PROFIT, GROSS -1.40, NET -2.09
2000-07-24, Close, 33.36
2000-07-25, Close, 33.80
2000-07-25, BUY CREATE, 33.80
Ref: 103
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730326.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-07-26, BUY EXECUTED, Price: 33.27, Cost: 332.70, Comm 0.33
2000-07-26, Close, 34.13
2000-07-27, Close, 33.38
2000-07-27, SELL CREATE, 33.38
2000-07-28, SELL EXECUTED, Price: 33.41, Cost: 332.70, Comm 0.33
2000-07-28, OPERATION PROFIT, GROSS 1.40, NET 0.73
2000-07-28, Close, 32.19
2000-07-31, Close, 33.44
2000-07-31, BUY CREATE, 33.44
Ref: 105
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730332.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-08-01, BUY EXECUTED, Price: 33.44, Cost: 334.40, Comm 0.33
2000-08-01, Close, 32.52
2000-08-01, SELL CREATE, 32.52
2000-08-02, SELL EXECUTED, Price: 32.47, Cost: 334.40, Comm 0.32
2000-08-02, OPERATION PROFIT, GROSS -9.70, NET -10.36
2000-08-02, Close, 32.52
2000-08-03, Close, 34.44
2000-08-03, BUY CREATE, 34.44
Ref: 107
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730335.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-08-04, BUY EXECUTED, Price: 34.83, Cost: 348.30, Comm 0.35
2000-08-04, Close, 36.27
2000-08-07, Close, 36.41
2000-08-08, Close, 36.91
2000-08-09, Close, 36.19
2000-08-10, Close, 35.61
2000-08-11, Close, 36.08
2000-08-14, Close, 36.64
2000-08-15, Close, 36.14
2000-08-16, Close, 36.11
2000-08-17, Close, 37.33
2000-08-18, Close, 36.16
2000-08-21, Close, 37.00
2000-08-22, Close, 37.16
2000-08-23, Close, 36.86
2000-08-24, Close, 37.66
2000-08-25, Close, 37.64
2000-08-28, Close, 38.58
2000-08-29, Close, 39.03
2000-08-30, Close, 39.25
2000-08-31, Close, 40.44
2000-09-01, Close, 41.19
2000-09-05, Close, 40.50
2000-09-06, Close, 39.69
2000-09-07, Close, 40.56
2000-09-08, Close, 38.50
2000-09-08, SELL CREATE, 38.50
2000-09-11, SELL EXECUTED, Price: 38.28, Cost: 348.30, Comm 0.38
2000-09-11, OPERATION PROFIT, GROSS 34.50, NET 33.77
2000-09-11, Close, 37.11
2000-09-12, Close, 35.30
2000-09-13, Close, 36.39
2000-09-14, Close, 37.78
2000-09-15, Close, 34.83
2000-09-18, Close, 34.01
2000-09-19, Close, 35.27
2000-09-20, Close, 35.55
2000-09-21, Close, 35.11
2000-09-22, Close, 35.91
2000-09-25, Close, 35.02
2000-09-26, Close, 35.33
2000-09-27, Close, 35.52
2000-09-28, Close, 36.24
2000-09-28, BUY CREATE, 36.24
Ref: 109
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730391.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-09-29, BUY EXECUTED, Price: 36.18, Cost: 361.80, Comm 0.36
2000-09-29, Close, 35.02
2000-09-29, SELL CREATE, 35.02
2000-10-02, SELL EXECUTED, Price: 35.47, Cost: 361.80, Comm 0.35
2000-10-02, OPERATION PROFIT, GROSS -7.10, NET -7.82
2000-10-02, Close, 35.02
2000-10-03, Close, 30.91
2000-10-04, Close, 30.30
2000-10-05, Close, 30.38
2000-10-06, Close, 30.08
2000-10-09, Close, 29.69
2000-10-10, Close, 28.74
2000-10-11, Close, 27.69
2000-10-12, Close, 28.02
2000-10-13, Close, 31.69
2000-10-16, Close, 30.74
2000-10-17, Close, 29.96
2000-10-18, Close, 29.85
2000-10-19, Close, 32.36
2000-10-19, BUY CREATE, 32.36
Ref: 111
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730412.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-10-20, BUY EXECUTED, Price: 32.13, Cost: 321.30, Comm 0.32
2000-10-20, Close, 31.35
2000-10-23, Close, 30.30
2000-10-24, Close, 31.85
2000-10-25, Close, 30.58
2000-10-26, Close, 30.30
2000-10-27, Close, 30.41
2000-10-30, Close, 28.13
2000-10-30, SELL CREATE, 28.13
2000-10-31, SELL EXECUTED, Price: 29.02, Cost: 321.30, Comm 0.29
2000-10-31, OPERATION PROFIT, GROSS -31.10, NET -31.71
2000-10-31, Close, 29.35
2000-11-01, Close, 27.91
2000-11-02, Close, 26.30
2000-11-03, Close, 26.96
2000-11-06, Close, 24.85
2000-11-07, Close, 23.63
2000-11-08, Close, 22.07
2000-11-09, Close, 24.18
2000-11-10, Close, 22.63
2000-11-13, Close, 22.01
2000-11-14, Close, 25.24
2000-11-15, Close, 25.68
2000-11-16, Close, 24.35
2000-11-17, Close, 25.63
2000-11-17, BUY CREATE, 25.63
Ref: 113
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730441.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-11-20, BUY EXECUTED, Price: 21.63, Cost: 216.30, Comm 0.22
2000-11-20, Close, 22.01
2000-11-20, SELL CREATE, 22.01
2000-11-21, SELL EXECUTED, Price: 22.07, Cost: 216.30, Comm 0.22
2000-11-21, OPERATION PROFIT, GROSS 4.40, NET 3.96
2000-11-21, Close, 21.24
2000-11-22, Close, 19.85
2000-11-24, Close, 21.46
2000-11-27, Close, 20.57
2000-11-28, Close, 20.15
2000-11-29, Close, 20.35
2000-11-30, Close, 23.57
2000-11-30, BUY CREATE, 23.57
Ref: 115
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730454.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-12-01, BUY EXECUTED, Price: 23.46, Cost: 234.60, Comm 0.23
2000-12-01, Close, 23.52
2000-12-04, Close, 25.07
2000-12-05, Close, 28.02
2000-12-06, Close, 26.85
2000-12-07, Close, 25.18
2000-12-08, Close, 26.74
2000-12-11, Close, 28.41
2000-12-12, Close, 27.35
2000-12-13, Close, 25.24
2000-12-14, Close, 24.46
2000-12-14, SELL CREATE, 24.46
2000-12-15, SELL EXECUTED, Price: 26.18, Cost: 234.60, Comm 0.26
2000-12-15, OPERATION PROFIT, GROSS 27.20, NET 26.70
2000-12-15, Close, 25.41
2000-12-15, BUY CREATE, 25.41
Ref: 117
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730469.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-12-18, BUY EXECUTED, Price: 26.68, Cost: 266.80, Comm 0.27
2000-12-18, Close, 28.46
2000-12-19, Close, 27.24
2000-12-20, Close, 25.35
2000-12-20, SELL CREATE, 25.35
2000-12-21, SELL EXECUTED, Price: 24.74, Cost: 266.80, Comm 0.25
2000-12-21, OPERATION PROFIT, GROSS -19.40, NET -19.91
2000-12-21, Close, 26.24
2000-12-21, BUY CREATE, 26.24
Ref: 119
OrdType: 0
OrdType: Buy
Status: 1
Status: Submitted
Size: 10
Price: None
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 0
ExecType: Market
CommInfo: None
End of Session: 730475.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2000-12-22, BUY EXECUTED, Price: 27.02, Cost: 270.20, Comm 0.27
2000-12-22, Close, 28.35
2000-12-26, Close, 27.52
2000-12-27, Close, 27.30
2000-12-28, Close, 27.63
2000-12-29, Close, 25.85
2000-12-29, SELL CREATE, 25.85
组合终结值: 99969.64
[[<Figure size 640x480 with 8 Axes>]]