Overall Statistics |
Total Trades 290 Average Win 0% Average Loss 0% Compounding Annual Return -0.358% Drawdown 0.100% Expectancy 0 Net Profit -0.061% Sharpe Ratio -1.143 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.003 Beta -0.001 Annual Standard Deviation 0.002 Annual Variance 0 Information Ratio 2.254 Tracking Error 0.187 Treynor Ratio 3.559 Total Fees $290.00 |
class HorizontalResistanceAutosequencers(QCAlgorithm): def Initialize(self): #Set start/end dates and cash self.SetStartDate(2018, 10, 18) self.SetEndDate(2018, 12, 18) self.SetCash(1000000) equity = self.AddEquity("AMD", Resolution.Hour, Market.USA, False, 1, True) self.syl = equity.Symbol #Set Brokerage Model self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash) #Add Securities from symbols and set data normalization mode to raw self.Securities[self.syl].SetDataNormalizationMode(DataNormalizationMode.Raw) #set variables for setsignal self.open = [] self.close = [] self.high = [] self.low = [] self.volume = [] self.time = [] self.Schedule.On(self.DateRules.EveryDay(self.syl),self.TimeRules.Every(TimeSpan.FromMinutes(60)),Action(self.SetSignal)) def SetSignal(self): history = self.History(1, Resolution.Hour) for slice in history: bar = slice[self.syl] self.open.append(bar.Open) self.close.append(bar.Close) self.high.append(bar.High) self.low.append(bar.Low) self.volume.append(bar.Volume) self.time.append(bar.Time) self.Debug("{0}: {1}: {2}: {3}: {4}: {5}".format(self.open[-1], self.close[-1], self.high[-1], self.low[-1], self.volume[-1], self.time[-1])) def OnData(self, data): '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. Arguments: data: Slice object keyed by symbol containing the stock data ''' self.MarketOrder("AMD", 1) # if not self.Portfolio.Invested: # self.SetHoldings("SPY", 1)