Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
14.117%
Drawdown
13.200%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0.974
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.003
Beta
1.006
Annual Standard Deviation
0.118
Annual Variance
0.014
Information Ratio
-0.245
Tracking Error
0.008
Treynor Ratio
0.114
Total Fees
$3.81
namespace QuantConnect 
{   
    public class BasicTemplateAlgorithm : QCAlgorithm
    {
    	private AverageTrueRange _atrDefault;
        private AverageTrueRange _atrExponential;
        
        public override void Initialize() 
        {
		    SetStartDate(2013, 1, 1);         
            
            AddSecurity(SecurityType.Equity, "SPY", Resolution.Daily);
            _atrDefault = ATR("SPY", 8);
            _atrExponential = ATR("SPY", 8, MovingAverageType.Exponential);
        }

        public void OnData(TradeBars data) 
        {   
            if (!Portfolio.HoldStock) SetHoldings("SPY", 1);
        }
        
        public override void OnEndOfDay()
        {
        	Plot("ATR", "ATR default", _atrDefault);
        	Plot("ATR", "Exponential", _atrExponential);
        }
    }
}