Overall Statistics
Total Trades
2
Average Win
0%
Average Loss
0%
Compounding Annual Return
534.061%
Drawdown
3.600%
Expectancy
0
Net Profit
7.704%
Sharpe Ratio
5.759
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
2.418
Beta
-38.161
Annual Standard Deviation
0.303
Annual Variance
0.092
Information Ratio
5.7
Tracking Error
0.304
Treynor Ratio
-0.046
Total Fees
$2.00
namespace QuantConnect.Algorithm.CSharp
{
    public class TachyonQuantumChicken : QCAlgorithm
    {
		private Security _jesus;
		
        public override void Initialize()
        {
            SetStartDate(2019, 1, 1);
            SetEndDate(2019, 1, 15);
            SetCash(10000);
            
            const decimal availableLeverage = 2;
            _jesus = AddEquity("SPY", Resolution.Minute, Market.USA, true, availableLeverage);
        }
        

        decimal _peakEquity = 1;
        decimal _maxDrawdown = 0;
        
        public override void OnData(Slice data)
        {
        	decimal equity = Portfolio.TotalPortfolioValue;
        	if (equity >= _peakEquity)
        	{
        		_peakEquity = equity;
        	}
        	else
        	{
        		decimal drawdown = 1 - equity / _peakEquity;
        		_maxDrawdown = Math.Max(_maxDrawdown, drawdown);
        	}
        	
        	SetRuntimeStatistic("MDD", _maxDrawdown * -100);
        	
        	SetHoldings(_jesus.Symbol, 1.337m);
        }
    }
}