Overall Statistics |
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
15.156%
Drawdown
5.500%
Expectancy
0
Net Profit
0%
Sharpe Ratio
1.197
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.005
Beta
0.996
Annual Standard Deviation
0.099
Annual Variance
0.01
Information Ratio
1.027
Tracking Error
0.004
Treynor Ratio
0.12
Total Fees
$2.44
|
class ScheduledEventsAlgorithm(QCAlgorithm): '''QCU Scheduled Events Algorithm''' def Initialize(self): self.SetStartDate(2016,6,1) #Set Start Date self.SetEndDate(2016,12,31) #Set End Date self.SetCash(100000) #Set Strategy Cash # Find more symbols here: http://quantconnect.com/data self.AddEquity("TLT", Resolution.Daily) self.AddEquity("SPY", Resolution.Daily) self.Schedule.On(self.DateRules.MonthStart("SPY"), self.TimeRules.AfterMarketOpen("SPY"), Action(self.RebalancingCode)) def OnData(self, data): '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.''' if not self.Portfolio.Invested: self.SetHoldings("SPY", 1) def RebalancingCode(self): self.Log(str(self.Time) + " > Message to log") self.Debug(str(self.Time) + " > Message to console") pass