【宽客学院】期权回测功能介绍

回测
期权
标签: #<Tag:0x00007f8c610eb1c8> #<Tag:0x00007f8c610eb088>

(iQuant) #1

期权作为一种非线性的金融衍生产品,在风险管理、投资组合构建方面有着重要作用,善用期权可以带来更好的风险收益情况。BigQuant平台上提供期权策略回测功能,本篇会通过两个常见的期权交易策略对此功能进行介绍。目前只支持金融期权的回测研究,未来会支持商品期权,期权回测功能我们也会逐步升级完善。

一、关于期权交易策略

相比于股票和期货,期权是一种更为复杂也更为灵活的投资工具。利用传统的投资工具,投资者只能通过判断市场的涨跌获取收益,而利用期权,无论是趋势市还是震荡市,投资者都有相应的策略来捕获盈利并控制风险。

我国A股市场可以交易的期权合约只有50ETF期权合约,所以我们可以通过组合股票指数和期权来构建期权交易策略。以看涨期权为例,常用的期权交易策略有:

  • 卖出备兑看涨期权:即持有标的物(股票指数)的同时卖出看涨期权
  • 卖出裸看涨期权:即没有标的持仓,直接卖空看涨期权
  • 看涨期权价差:在买入一个看涨期权的同时卖出另一个看涨期权,两个期权标的相同
  • 牛市跨期价差:卖出近期的看涨期权和买入较远期的看涨期权,但标的股票价格会比这些看涨期权的行权价低一定的幅度
  • 蝶式价差:同时买入1手行权价最低的和最高的看涨期权,卖出2手中间行权价的看涨期权

后文将利用BigQuant平台复现“卖出备兑看涨期权”和“蝶式价差”策略。

二、如何进行期权策略回测

设置策略基本参数 => 根据策略逻辑编写回测主体函数 => 启动回测

下面将按照以上步骤的顺序,介绍期权回测中涉及的基本设置、函数和功能性api:

1. 基本参数

(1)回测起始时间

# 回测起始时间
start_date = '2019-06-27'
# 回测结束时间
end_date = '2019-07-03'

(2)策略参考标准

# 策略比较参考标准,以沪深300为例
benchmark = '000300.SHA'

(3)交易标的:50ETF期权合约

instruments = ['510050.HOF'] #tareget product

(4)起始资金

capital_base = 1000000

2. 回测主体

回测主体包含初始化、盘前设置、盘中处理三个函数,需要用到几个设置。
(1)设置手续费:

set_commission(PerOrder(buy_cost=0.0003, sell_cost=0.0013, min_cost=3)) 

(2)设置合约单位 :

sid.set_multiplier(1.0)  # 设置合约单位为一手

(3)设置期权方向:

  • 看涨:用1表示,或者直接用OptionType.CALL表示,一般和数据api配合使用
  • 看跌:用0表示,或者直接用OptionType.PUT表示,一般和数据api配合使用
from zipline.finance.constants import OptionType
sid1 = context.lookup_option_asset('510050.HOF', '201908', 2.70, OptionType.CALL, 0)

(4)转化为symbol对象:

# 标的物转换成symbol对象
context.symbol('510050.HOF')
# 期权合约转换成symbol对象
context.future_symbol('1001889.SHAO')

(5)获取期权合约:

context.lookup_option_asset(underlying, month_time, strike_price, option_type, adjust_flag)
  • underlying,标的物,str
  • month_time,期权到期月份,str,格式为‘yyyymm’
  • strike_price,执行价,float
  • option_type,期权方向,float,1表示看涨,0表示看跌
  • adjust_flag=0,是否复权,1表示复权,0表示不复权

(6)获取合约执行价格:

context.get_option_strike_prices(underlying, month_time)
  • underlying,标的物,str
  • month_time,期权到期月份,str,格式为‘yyyymm’

一般来讲,在初始化函数中设置交易手续费(只在第一个交易日运行),在盘前设置函数中获取日期等信息(每日运行),在盘中处理函数中实现策略逻辑(每日运行),进行买卖操作。一个示例代码如下:

示例代码
# 初始化函数:初始化虚拟账户状态,只在第一个交易日运行
def initialize(context):
    print("initialize")
    context.set_commission(futures_commission=PerContract(cost={'IF':(0.0023, 0.0015, 0.0023)}))
    context.index = 0

# 盘前设置函数:每日运行,得到交易日期
def before_trading_start(context, data):
    print("before_trading_start:", data.current_dt)
    pass

# 盘中处理函数:每日运行,进行交易
def handle_data(context, data):
    context.index += 1
    if context.index == 1:
        sid1=context.symbol('510050.HOF')
 
        context.order(sid1,1000)
        sid2 = context.lookup_option_asset('510050.HOF', '201908',3.0, OptionType.CALL, 0)
        sid2.set_multiplier(1.0)
        context.order(sid2, -10)

3. 启动回测

M.trade.v4(start_date, end_date, handle_data,instruments, options_data, history_ds,bench_mark_ds, prepare, initialize=,before_trading_start, volume_limit,order_price_field_buy,order_price_field_sell,capital_base, benchmark,auto_cancel_non_tradable_orders, data_frequency,price_type, plot_charts,backtest_only, options,amount_integer, m_meta_kwargs)

回测函数,具体介绍见帮助文档【回测与交易引擎

三、期权交易策略样例

1. 牛市跨期价差

策略逻辑是卖出近期的看涨期权和买入较远期的看涨期权,但标的股票价格会比这些看涨期权的行权价低一定的幅度。

克隆策略

    {"Description":"实验创建于2019/9/4","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-9:instruments","SourceOutputPortId":"-112:data"}],"ModuleNodes":[{"Id":"-9","ModuleId":"BigQuantSpace.trade.trade-v4","ModuleParameters":[{"Name":"start_date","Value":"2019-05-23","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2019-07-10","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"initialize","Value":"# 回测引擎:初始化函数,只执行一次\ndef bigquant_run(context):\n print(\"initialize\")\n # context.set_commission(futures_commission=PerContract(cost={'IF':(0.0023, 0.0015, 0.0023)}))\n\n context.index = 0","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"handle_data","Value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n from zipline.finance.constants import OptionType\n context.index += 1\n if context.index == 1:\n\n # 卖出近期的看涨期权,买入远期看涨期权\n sid1 = context.lookup_option_asset('510050.HOF', '201908', 2.7, OptionType.CALL, 0)\n sid2 = context.lookup_option_asset('510050.HOF', '201909', 3.4, OptionType.CALL, 0)\n context.order(sid1,-1)\n context.order(sid2,1)\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"prepare","Value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n \n pass\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"before_trading_start","Value":"# 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。\ndef bigquant_run(context, data):\n #print(\"before_trading_start:\", data.current_dt)\n pass\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"volume_limit","Value":0.025,"ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"order_price_field_buy","Value":"open","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"order_price_field_sell","Value":"close","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"capital_base","Value":"1000","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"auto_cancel_non_tradable_orders","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"data_frequency","Value":"daily","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"price_type","Value":"真实价格","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"product_type","Value":"期权","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"plot_charts","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"backtest_only","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"benchmark","Value":"000300.SHA","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-9"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"options_data","NodeId":"-9"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"history_ds","NodeId":"-9"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"benchmark_ds","NodeId":"-9"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"trading_calendar","NodeId":"-9"}],"OutputPortsInternal":[{"Name":"raw_perf","NodeId":"-9","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":1,"Comment":"","CommentCollapsed":true},{"Id":"-112","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_FUTURE","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"510050.HOF","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-112"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-112","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"Comment":"","CommentCollapsed":true}],"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions><NodePosition Node='-9' Position='487,498,200,200'/><NodePosition Node='-112' Position='475,324,200,200'/></NodePositions><NodeGroups /></DataV1>"},"IsDraft":true,"ParentExperimentId":null,"WebService":{"IsWebServiceExperiment":false,"Inputs":[],"Outputs":[],"Parameters":[{"Name":"交易日期","Value":"","ParameterDefinition":{"Name":"交易日期","FriendlyName":"交易日期","DefaultValue":"","ParameterType":"String","HasDefaultValue":true,"IsOptional":true,"ParameterRules":[],"HasRules":false,"MarkupType":0,"CredentialDescriptor":null}}],"WebServiceGroupId":null,"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions></NodePositions><NodeGroups /></DataV1>"},"DisableNodesUpdate":false,"Category":"user","Tags":[],"IsPartialRun":true}
    In [11]:
    # 本代码由可视化策略环境自动生成 2019年9月4日 17:40
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    # 回测引擎:初始化函数,只执行一次
    def m1_initialize_bigquant_run(context):
        print("initialize")
        # context.set_commission(futures_commission=PerContract(cost={'IF':(0.0023, 0.0015, 0.0023)}))
    
        context.index = 0
    # 回测引擎:每日数据处理函数,每天执行一次
    def m1_handle_data_bigquant_run(context, data):
        from zipline.finance.constants import OptionType
        context.index += 1
        if context.index == 1:
    
           # 卖出近期的看涨期权,买入远期看涨期权
            sid1 = context.lookup_option_asset('510050.HOF', '201908', 2.7, OptionType.CALL, 0)
            sid2 = context.lookup_option_asset('510050.HOF', '201909', 3.4, OptionType.CALL, 0)
            context.order(sid1,-1)
            context.order(sid2,1)
    
    # 回测引擎:准备数据,只执行一次
    def m1_prepare_bigquant_run(context):
        
        pass
    
    # 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。
    def m1_before_trading_start_bigquant_run(context, data):
        #print("before_trading_start:", data.current_dt)
        pass
    
    
    m2 = M.instruments.v2(
        start_date='',
        end_date='',
        market='CN_FUTURE',
        instrument_list='510050.HOF',
        max_count=0
    )
    
    m1 = M.trade.v4(
        instruments=m2.data,
        start_date='2019-05-23',
        end_date='2019-07-10',
        initialize=m1_initialize_bigquant_run,
        handle_data=m1_handle_data_bigquant_run,
        prepare=m1_prepare_bigquant_run,
        before_trading_start=m1_before_trading_start_bigquant_run,
        volume_limit=0.025,
        order_price_field_buy='open',
        order_price_field_sell='close',
        capital_base=1000,
        auto_cancel_non_tradable_orders=True,
        data_frequency='daily',
        price_type='真实价格',
        product_type='期权',
        plot_charts=True,
        backtest_only=False,
        benchmark='000300.SHA'
    )
    
    initialize
    
    • 收益率13.9%
    • 年化收益率162.39%
    • 基准收益率3.76%
    • 阿尔法0.63
    • 贝塔2.31
    • 夏普比率1.55
    • 胜率1.0
    • 盈亏比0.0
    • 收益波动率80.0%
    • 信息比率0.09
    • 最大回撤21.32%
    bigcharts-data-start/{"__id":"bigchart-95ab7909a90149b8b3c46554868940cc","__type":"tabs"}/bigcharts-data-end

    2. 蝶式价差

    策略逻辑是买入1手行权价最低的看涨期权,卖出2手中间行权价的看涨期权,买入1手行权价最高的看涨期权,进行套利。

    克隆策略

      {"Description":"实验创建于2019/9/4","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-9:instruments","SourceOutputPortId":"-82:data"}],"ModuleNodes":[{"Id":"-9","ModuleId":"BigQuantSpace.trade.trade-v4","ModuleParameters":[{"Name":"start_date","Value":"2019-07-20","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2019-08-20","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"initialize","Value":"# 回测引擎:初始化函数,只执行一次\ndef bigquant_run(context):\n print(\"initialize\")\n # context.set_commission(futures_commission=PerContract(cost={'IF':(0.0023, 0.0015, 0.0023)}))\n context.index = 0\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"handle_data","Value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n from zipline.finance.constants import OptionType\n context.index += 1\n if context.index == 1:\n prices = context.get_option_strike_prices( '510050.HOF', '201908')\n min_p = np.min(prices)\n max_p = np.max(prices)\n median_p = np.median(prices)\n \n ## 1 买入1手行权价最低的看涨期权\n sid1 = context.lookup_option_asset('510050.HOF', '201908', min_p, OptionType.CALL, 0)\n sid1.set_multiplier(1000)\n context.order(sid1, 1)\n\n ## 2 卖出2手中间行权价的看涨期权\n sid2 = context.lookup_option_asset('510050.HOF', '201908', median_p, OptionType.CALL, 0)\n sid2.set_multiplier(1000)\n context.order(sid2, -2)\n\n ## 3 买入1手行权价最高的看涨期权\n sid3 = context.lookup_option_asset('510050.HOF', '201908', max_p, OptionType.CALL, 0)\n sid3.set_multiplier(1000)\n context.order(sid3, 1) \n \n print('===', sid1, sid2, sid3)","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"prepare","Value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n pass\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"before_trading_start","Value":"# 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。\ndef bigquant_run(context, data):\n #print(\"before_trading_start:\", data.current_dt)\n pass\n\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"volume_limit","Value":0.025,"ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"order_price_field_buy","Value":"open","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"order_price_field_sell","Value":"close","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"capital_base","Value":"1000","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"auto_cancel_non_tradable_orders","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"data_frequency","Value":"daily","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"price_type","Value":"真实价格","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"product_type","Value":"期权","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"plot_charts","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"backtest_only","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"benchmark","Value":"000300.SHA","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-9"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"options_data","NodeId":"-9"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"history_ds","NodeId":"-9"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"benchmark_ds","NodeId":"-9"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"trading_calendar","NodeId":"-9"}],"OutputPortsInternal":[{"Name":"raw_perf","NodeId":"-9","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":1,"Comment":"","CommentCollapsed":true},{"Id":"-82","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_FUTURE","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"510050.HOF","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-82"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-82","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"Comment":"","CommentCollapsed":true}],"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions><NodePosition Node='-9' Position='374.48358154296875,400.4976501464844,200,200'/><NodePosition Node='-82' Position='322.23760986328125,269.4967041015625,200,200'/></NodePositions><NodeGroups /></DataV1>"},"IsDraft":true,"ParentExperimentId":null,"WebService":{"IsWebServiceExperiment":false,"Inputs":[],"Outputs":[],"Parameters":[{"Name":"交易日期","Value":"","ParameterDefinition":{"Name":"交易日期","FriendlyName":"交易日期","DefaultValue":"","ParameterType":"String","HasDefaultValue":true,"IsOptional":true,"ParameterRules":[],"HasRules":false,"MarkupType":0,"CredentialDescriptor":null}}],"WebServiceGroupId":null,"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions></NodePositions><NodeGroups /></DataV1>"},"DisableNodesUpdate":false,"Category":"user","Tags":[],"IsPartialRun":true}
      In [31]:
      # 本代码由可视化策略环境自动生成 2019年9月4日 17:36
      # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
      
      
      # 回测引擎:初始化函数,只执行一次
      def m1_initialize_bigquant_run(context):
          print("initialize")
          # context.set_commission(futures_commission=PerContract(cost={'IF':(0.0023, 0.0015, 0.0023)}))
          context.index = 0
      
      # 回测引擎:每日数据处理函数,每天执行一次
      def m1_handle_data_bigquant_run(context, data):
          from zipline.finance.constants import OptionType
          context.index += 1
          if context.index == 1:
              prices = context.get_option_strike_prices( '510050.HOF', '201908')
              min_p = np.min(prices)
              max_p = np.max(prices)
              median_p = np.median(prices)
              
              ## 1 买入1手行权价最低的看涨期权
              sid1 = context.lookup_option_asset('510050.HOF', '201908', min_p, OptionType.CALL, 0)
              sid1.set_multiplier(1000)
              context.order(sid1, 1)
      
              ## 2 卖出2手中间行权价的看涨期权
              sid2 = context.lookup_option_asset('510050.HOF', '201908', median_p, OptionType.CALL, 0)
              sid2.set_multiplier(1000)
              context.order(sid2, -2)
      
              ## 3 买入1手行权价最高的看涨期权
              sid3 = context.lookup_option_asset('510050.HOF', '201908', max_p, OptionType.CALL, 0)
              sid3.set_multiplier(1000)
              context.order(sid3, 1)    
              
              print('===', sid1, sid2, sid3)
      # 回测引擎:准备数据,只执行一次
      def m1_prepare_bigquant_run(context):
          pass
      
      # 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。
      def m1_before_trading_start_bigquant_run(context, data):
          #print("before_trading_start:", data.current_dt)
          pass
      
      
      
      m2 = M.instruments.v2(
          start_date='',
          end_date='',
          market='CN_FUTURE',
          instrument_list='510050.HOF',
          max_count=0
      )
      
      m1 = M.trade.v4(
          instruments=m2.data,
          start_date='2019-07-20',
          end_date='2019-08-20',
          initialize=m1_initialize_bigquant_run,
          handle_data=m1_handle_data_bigquant_run,
          prepare=m1_prepare_bigquant_run,
          before_trading_start=m1_before_trading_start_bigquant_run,
          volume_limit=0.025,
          order_price_field_buy='open',
          order_price_field_sell='close',
          capital_base=1000,
          auto_cancel_non_tradable_orders=True,
          data_frequency='daily',
          price_type='真实价格',
          product_type='期权',
          plot_charts=True,
          backtest_only=False,
          benchmark='000300.SHA'
      )
      
      initialize
      
      === Option(319 [10001935.SHAO]) Option(42 [10001887.SHAO]) Option(113 [10001905.SHAO])
      
      • 收益率2.84%
      • 年化收益率37.82%
      • 基准收益率-0.53%
      • 阿尔法0.48
      • 贝塔-1.05
      • 夏普比率0.73
      • 胜率0.33
      • 盈亏比2.97
      • 收益波动率76.1%
      • 信息比率0.05
      • 最大回撤15.08%
      bigcharts-data-start/{"__id":"bigchart-cfea9d0988944a20bcabc3fdd88cc797","__type":"tabs"}/bigcharts-data-end

      (a20180322) #6

      克隆后直接运行报错
      2020-11-21 18:58:44.897110] ERROR: moduleinvoker: module name: backtest, module version: v8, trackeback: Traceback (most recent call last): TypeError: ‘NoneType’ object is not subscriptable

      [2020-11-21 18:58:44.901381] ERROR: moduleinvoker: module name: trade, module version: v4, trackeback: Traceback (most recent call last): TypeError: ‘NoneType’ object is not subscriptable