18 using System.Collections.Generic;
29 private readonly decimal _maximumDrawdownPercent;
37 decimal maximumDrawdownPercent = 0.05m
40 _maximumDrawdownPercent = -Math.Abs(maximumDrawdownPercent);
50 foreach (var kvp
in algorithm.Securities)
52 var security = kvp.Value;
54 if (!security.Invested)
59 var pnl = security.Holdings.UnrealizedProfitPercent;
60 if (pnl < _maximumDrawdownPercent)
62 var symbol = security.Symbol;
65 algorithm.Insights.Cancel(
new[] { symbol });