| Overall Statistics |
|
Total Trades 2 Average Win 0% Average Loss 0% Compounding Annual Return 111.817% Drawdown 3.400% Expectancy 0 Net Profit 4.987% Sharpe Ratio 8.742 Probabilistic Sharpe Ratio 95.052% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.094 Beta 1.366 Annual Standard Deviation 0.127 Annual Variance 0.016 Information Ratio 3.63 Tracking Error 0.063 Treynor Ratio 0.812 Total Fees $2.00 Estimated Strategy Capacity $2400000.00 Lowest Capacity Asset IGW S6BDJ8ONH2ZP |
class Example_Plot(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2021, 10, 4)
Today = datetime.now().date()
TodayTime = datetime.now()
self.Debug(f'{TodayTime} UTC_Time')
self.SetEndDate(Today)
#self.SetEndDate(2021, 10, 29)
self.SetCash(100000)
self.SetTimeZone("America/New_York")
self.SetWarmUp(10, Resolution.Daily)
self.Data = {}
self.symbols = ["QQQ", "SOXX"]
for ticker in self.symbols:
security = self.AddEquity(ticker, Resolution.Minute)
symbol = security.Symbol
self.Data[symbol] = SymbolData(self, security, symbol)
stockPlot = Chart(ticker)
stockPlot.AddSeries(Series("Price", SeriesType.Line, 0))
self.AddChart(stockPlot)
def OnData(self, data):
for symbol in self.Data.keys():
SymbolData = self.Data[symbol]
if (not self.Portfolio[symbol].Invested):
self.SetHoldings(symbol, 1/len(self.symbols))
def OnEndOfDay(self, symbol):
self.Debug(f'Plot {self.Time} {self.UtcTime}')
if self.IsWarmingUp: return
SymbolData = self.Data[symbol]
if self.Time >= self.StartDate:
self.Plot(symbol.Value, "Price", SymbolData.close.Current.Value)
class SymbolData(object):
def __init__(self, algorithm, security, symbol):
self.algorithm = algorithm
self.close = algorithm.SMA(symbol, 1, Resolution.Daily)