获取当前账户的买入持仓合约码

def GetBuyPositionCode(context,) :

''' 获取当前账户的买入持仓合约码 ''' hold_code, option, option.buysellflag = [], PBObj(), '0' for p in context.myacc.GetPositions(option) : hold_code.append(p.contract) return hold_code