Overall Statistics
using QuantConnect.Statistics;

namespace QuantConnect.Algorithm.CSharp
{
    public class UncoupledModulatedAtmosphericScrubbers : QCAlgorithm
    {
    	public SortedDictionary<DateTime,decimal> equityOverTime = new SortedDictionary<DateTime,decimal>();
    	
        public override void Initialize()
		{ 
			SetStartDate(2020, 1, 1);
			SetEndDate(2020, 2, 1);
		    AddEquity("SPY", Resolution.Minute);
		} 
		
		public void OnData(TradeBars data) {
		    if (!Portfolio.Invested)
		    	SetHoldings("SPY", 1);
		}
		
		public override void OnEndOfDay() 
		{
			equityOverTime.Add(Time, Portfolio.TotalPortfolioValue);	
		}
		
		public override void OnEndOfAlgorithm() 
		{
			Debug("DD: " + QuantConnect.Statistics.Statistics.DrawdownPercent(equityOverTime,2));
		}
    }
}