Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 256.493% Drawdown 1.400% Expectancy 0 Net Profit 0% Sharpe Ratio 4.303 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.019 Beta 1.007 Annual Standard Deviation 0.194 Annual Variance 0.038 Information Ratio -7.185 Tracking Error 0.002 Treynor Ratio 0.83 Total Fees $3.21 |
class DataConsolidationAlgorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2013, 10, 07) #Set Start Date self.SetEndDate(2013, 10, 11) #Set End Date # Find more symbols here: http://quantconnect.com/data equity = self.AddEquity("SPY") self.spy = equity.Symbol consolidator = TradeBarConsolidator(TimeSpan.FromDays(1)) consolidator.DataConsolidated += self.DailyConsolidator self.SubscriptionManager.AddConsolidator(self.spy, consolidator) def OnData(self, data): pass def DailyConsolidator(self, sender, bar): self.Log("{0} {1}".format(str(bar), bar.Volume)) if not self.Portfolio.Invested: self.SetHoldings(self.spy, 1);