Commit 9ebf8977 authored by wenwen.tang's avatar wenwen.tang 😕
parent f5f3ec36
......@@ -175,9 +175,10 @@ 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]
records = [record for record in records if annual.get(record['id']) > volatility]
filtered.extend(records)
for f in filtered:
funds.remove(f)
......
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