def get_positions(self):
    ' 返回持仓数量'
    pos_list = []
    if (self.pos > 0):
        pos_list.append({'vt_symbol': self.vt_symbol, 'direction': 'long', 'volume': self.pos})
    elif (self.pos < 0):
        pos_list.append({'vt_symbol': self.vt_symbol, 'direction': 'short', 'volume': abs(self.pos)})
    return pos_list
返回持仓数量
def get_positions(self):
    ' '
    pos_list = []
    if (self.pos > 0):
        pos_list.append({'vt_symbol': self.vt_symbol, 'direction': 'long', 'volume': self.pos})
    elif (self.pos < 0):
        pos_list.append({'vt_symbol': self.vt_symbol, 'direction': 'short', 'volume': abs(self.pos)})
    return pos_list