def save_dist(self, dist_data):
    '\n        保存策略逻辑过程记录=》 csv文件按\n        :param dist_data:\n        :return:\n        '
    if self.backtesting:
        save_path = self.cta_engine.get_logs_path()
    else:
        save_path = self.cta_engine.get_data_path()
    try:
        if (self.position and ('long_pos' not in dist_data)):
            dist_data.update({'long_pos': self.position.long_pos})
        if (self.position and ('short_pos' not in dist_data)):
            dist_data.update({'short_pos': self.position.short_pos})
        file_name = os.path.abspath(os.path.join(save_path, f'{self.strategy_name}_dist.csv'))
        append_data(file_name=file_name, dict_data=dist_data, field_names=self.dist_fieldnames)
    except Exception as ex:
        self.write_error(u'save_dist 异常:{} {}'.format(str(ex), traceback.format_exc()))
保存策略逻辑过程记录=》 csv文件按
:param dist_data:
:return:
def save_dist(self, dist_data):
    '\n        保存策略逻辑过程记录=》 csv文件按\n        :param dist_data:\n        :return:\n        '
    if self.backtesting:
        save_path = self.cta_engine.get_logs_path()
    else:
        save_path = self.cta_engine.get_data_path()
    try:
        if (self.position and ('long_pos' not in dist_data)):
            dist_data.update({'long_pos': self.position.long_pos})
        if (self.position and ('short_pos' not in dist_data)):
            dist_data.update({'short_pos': self.position.short_pos})
        file_name = os.path.abspath(os.path.join(save_path, f'{self.strategy_name}_dist.csv'))
        append_data(file_name=file_name, dict_data=dist_data, field_names=self.dist_fieldnames)
    except Exception as ex:
        self.write_error(u'save_dist 异常:{} {}'.format(str(ex), traceback.format_exc()))