We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
def _to_valide_goals(self, goals_raw): #goals_raw =基于投资范围以及策略选出来的标的 #univ =quantos分配的策略标的 univ, msg = self.ctx.trade_api.query_universe() univ.loc[:, 'size'] = 0.0 univ.loc[:, 'ref_price'] = 0.0 univ = univ.set_index('security').sort_index(axis=0) univ = univ[['size', 'ref_price']] for d in goals_raw: symbol = d['symbol'] size = d['size'] # TODO: better method needed if symbol in univ.index and symbol in self.univ_price_dic: univ.loc[symbol, 'ref_price'] = self.univ_price_dic[symbol]['last'] if size > 0: univ.loc[symbol, 'size'] = size univ = univ[univ['size']>0] #add by geekgu goals_valid = list(univ.reset_index().to_dict(orient='index').values()) return goals_valid
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: