Commit f56ed3dd authored by wenwen.tang's avatar wenwen.tang 😕
parent 34ac0de5
......@@ -167,9 +167,11 @@ class FundDividendSortinoAssetOptimize(SortinoAssetOptimize):
exclude = f.get('exclude')
volatility = f.get('volatility')
records = [fund for fund in funds if fund['customType'] == customType and fund['id'] in annual.keys()]
exclude = exclude if len(records) > exclude else len(records)
records = records[0:-exclude]
records = [record for record in records if annual.get(record['id']) > volatility]
if exclude:
exclude = exclude if len(records) > exclude else len(records)
records = records[0:-exclude]
if volatility:
records = [record for record in records if annual.get(record['id']) > volatility]
filtered.extend(records)
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