Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 201.100% Drawdown 0.700% Expectancy 0 Net Profit 3.274% Sharpe Ratio 18.926 Probabilistic Sharpe Ratio 99.919% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.014 Beta 0.982 Annual Standard Deviation 0.075 Annual Variance 0.006 Information Ratio -28.739 Tracking Error 0.001 Treynor Ratio 1.448 Total Fees $1.00 Estimated Strategy Capacity $110000000.00 Lowest Capacity Asset SPY R735QTJ8XC9X Portfolio Turnover 8.95% |
#region imports from AlgorithmImports import * #endregion from collections import deque class AdaptableSkyBlueHornet(QCAlgorithm): def Initialize(self): self.SetStartDate(2023, 6, 5) self.SetEndDate(2023, 6,15) self.SetCash(10000) self.spy = self.AddEquity("SPY", Resolution.Hour).Symbol self.rcd = self.AddEquity("RCD", Resolution.Hour).Symbol self.rhs = self.AddEquity("RHS", Resolution.Hour).Symbol # self.sma = self.SMA(self.spy, 30, Resolution.Daily) # History warm up for shortcut helper SMA indicator # closing_prices = self.History(self.spy, 30, Resolution.Daily)["close"] # for time, price in closing_prices.loc[self.spy].items(): # self.sma.Update(time, price) # Custom SMA indicator def OnData(self, slice): price = self.Securities[self.spy].Close exchange = self.Securities[self.spy].Exchange high = self.Securities[self.rcd].High low = self.Securities[self.rcd].Low close = self.Securities[self.rcd].Close vol = self.Securities[self.rcd].Volume open = self.Securities[self.rcd].Close rcd = self.Securities[self.rcd].Close rhs = self.Securities[self.rhs].Open self.Debug ("{} slice: {}".format(self.Time, str(slice.Bars["RCD"]))) #self.Log ("{} RCD high:{:.2f} low:{:.2f} close:{:.2f} open:{:.2f} vol:{}".format(self.Time, #high, low, close, open, vol)) #self.Debug("{} RHS:{:.2f} RCD:{:.2f} CurrRatio:{:.2f} SPY:{:.2f}".format(self.Time, rhs, rcd, rhs/rcd, price)) self.SetHoldings(self.spy, 1) self.Plot("Benchmark", "RCD", rcd) self.Plot("Benchmark", "RHS", rhs) #self.Plot("Benchmark", "SMA", self.sma.Current.Value)