Overall Statistics |
Total Trades 7 Average Win 0.39% Average Loss 0% Compounding Annual Return 67.866% Drawdown 0.100% Expectancy 0 Net Profit 1.525% Sharpe Ratio 12.871 Probabilistic Sharpe Ratio 100.000% Loss Rate 0% Win Rate 100% Profit-Loss Ratio 0 Alpha 0.415 Beta -0.046 Annual Standard Deviation 0.024 Annual Variance 0.001 Information Ratio -20.68 Tracking Error 0.096 Treynor Ratio -6.639 Total Fees $91.83 |
from System.Drawing import Color class VerticalTransdimensionalAutosequencers(QCAlgorithm): def Initialize(self): self.SetStartDate(2021, 2, 1) # Set Start Date self.SetCash(1000000) # Set Strategy Cash self.symbol = self.AddEquity("SPY", Resolution.Hour).Symbol self.EnableAutomaticIndicatorWarmUp = True self.ema = self.EMA(self.symbol, 10) # below is for fancy charting stockPlot = Chart('Custom') stockPlot.AddSeries(Series('long', SeriesType.Scatter, '$', Color.Green, ScatterMarkerSymbol.Triangle)) stockPlot.AddSeries(Series('liquidate', SeriesType.Scatter, '$', Color.Red, ScatterMarkerSymbol.TriangleDown)) self.AddChart(stockPlot) def OnData(self, data): if not (data.ContainsKey(self.symbol) and data[self.symbol] is not None): return price = data[self.symbol].Price if not self.Portfolio.Invested: if self.ema.Current.Value > price: self.SetHoldings(self.symbol, 1) self.Plot("Custom", "long", price) elif self.ema.Current.Value < price: self.Liquidate(self.symbol) self.Plot("Custom", "liquidate", price)