Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
193.931%
Drawdown
16.400%
Expectancy
0
Net Profit
0%
Sharpe Ratio
1.796
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.909
Beta
1.54
Annual Standard Deviation
0.564
Annual Variance
0.318
Information Ratio
1.719
Tracking Error
0.55
Treynor Ratio
0.658
Total Fees
$98.43
namespace QuantConnect 
{   
    /*
    *   Basic Template Algorithm
    *
    *   The underlying QCAlgorithm class has many methods which enable you to use QuantConnect.
    *   We have explained some of these here, but the full base class can be found at:
    *   https://github.com/QuantConnect/Lean/tree/master/Algorithm
    */
    public class BasicTemplateAlgorithm : QCAlgorithm
    {
    	string STOCK = "MACK";
        public override void Initialize() 
        {
        	// backtest parameters
        	
            SetStartDate(2017, 8, 10);         
            SetEndDate(2017, 9, 15);
            SetCash(25000);
            
            AddEquity(STOCK, Resolution.Minute);
            Securities[STOCK].SetDataNormalizationMode(DataNormalizationMode.Raw);
        }

        public override void OnData(Slice data) 
        {
        	var bars = data.Bars;
        	var splits = data.Splits;
        	var dividends = data.Dividends;
        	
        	foreach (var d in splits)
            {
            	Log("splits on " + d.Key + " factor " + d.Value.SplitFactor);
            }
        	
        	foreach (var d in dividends)
            {
            	Log("splits on " + d.Key + " factor " + d.Value.Distribution);
            }
        	
        	TradeBar bar;
        	if (bars.ContainsKey(STOCK)) 
        		bar = bars[STOCK];
        	
            if (!Portfolio.HoldStock) 
            {
                SetHoldings(STOCK, 1);
            }
        }
        public override void OnEndOfDay()
        {
        	Log("### PORTFOLIO " + Time.ToString() + " ###");
        	foreach(var p in Portfolio)
        	{
        		if (p.Value.Quantity != 0)
        			Log(p.Key + " * " + p.Value.Quantity.ToString("#.####"));
        	}
        	Log("#");
        	
        }
    }
}