根据ATRRSI的模版修改. 在variables加入参数并在开始给予默认值. 但是一但策略停止保存策略文件就会报错. 查看cta_strategy_data.json就会发现.就是自定义变量开始只有变量名后面没有数值. 但是在保存json之前把data打出来. 却有数值. 这是为什么? 出问题的就是start_money. 后面的变量也都没有保存进json中
data {'pos': 0, 'atr_value': 53.824688969253884, 'atr_ma': 52.38297221902349, 'rsi_value': 65.1315576720099, 'rsi_buy': 63, 'rsi_sell': 37, 'intra_trade_high': 35606.5, 'intra_trade_low': 35547, 'start_money': 4941241, 'end_money': 0, 'last_buyid': 0, 'last_sellid': 0, 'last_shortid': 0, 'last_coverid': 0}