Commit 4ed943db authored by stephen.wang's avatar stephen.wang

Merge remote-tracking branch 'origin/dev-dividend' into dev-dividend

parents 72456eaa 9ebf8977
......@@ -175,10 +175,11 @@ class FundDividendSortinoAssetOptimize(SortinoAssetOptimize):
records = [fund for fund in funds if fund['customType'] == customType and fund['id'] in annual.keys()]
if exclude is not None:
exclude = exclude if len(records) > exclude else len(records)
filtered.extend(records[-exclude:])
if exclude > 0:
records = records[:len(records) - exclude]
if volatility is not None:
records = [record for record in records[0:exclude] if annual.get(record['id']) > volatility]
filtered.extend(records)
records = [record for record in records if annual.get(record['id']) > volatility]
filtered.extend(records)
for f in filtered:
funds.remove(f)
return funds
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment