@support Thanks for the feedback. I would like to ask the following, for example if I want to filter out the 10 tickers with the best sharpe of the strategy, how should I do it, to avoid being filtered by hand?
Please provide an example code
def filter_sharpe_ratio(data, weights, top_assets):
stats_per_asset = qnstats.calc_stat(data, weights, per_asset=True)
sharpe_ratio = stats_per_asset.sel(field="sharpe_ratio")
return qnfilter.rank_assets_by(data, sharpe_ratio, top_assets, ascending=False)
asset_filter = filter_sharpe_ratio(data, weights, 150)
weights = weights * asset_filter
I used this code, but the result is still nearly 300 tickers.